Skip to content

Commit 9afc24b

Browse files
Junkrat77ob-robot
authored andcommitted
PullRequest: 348 fix agent status maintainer
1 parent 9f75a47 commit 9afc24b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

agent/service/task/status_maintainer.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,9 @@ func (maintainer *agentStatusMaintainer) setStatus(tx *gorm.DB, newStatus int, o
192192
if resp.Error != nil {
193193
return resp.Error
194194
}
195+
if resp.RowsAffected == 0 {
196+
return fmt.Errorf("failed to start maintenance: agent status is not %d", oldStatus)
197+
}
195198
return nil
196199
}
197200

0 commit comments

Comments
 (0)