mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
Merge pull request #3958 from wanyaoqi/bugfix/wyq/fix-host-ping-task
bugfix: add lock on host detected offline
This commit is contained in:
@@ -4283,11 +4283,13 @@ func (manager *SHostManager) PingDetectionTask(ctx context.Context, userCred mcc
|
||||
defer rows.Close()
|
||||
|
||||
for rows.Next() {
|
||||
var host = SHost{}
|
||||
q.Row2Struct(rows, &host)
|
||||
host.SetModelManager(manager, &host)
|
||||
var host = new(SHost)
|
||||
q.Row2Struct(rows, host)
|
||||
host.SetModelManager(manager, host)
|
||||
lockman.LockObject(ctx, host)
|
||||
host.PerformOffline(ctx, userCred, nil, nil)
|
||||
host.MarkGuestUnknown(userCred)
|
||||
lockman.ReleaseObject(ctx, host)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user