summaryrefslogtreecommitdiff
path: root/pkg/worker
diff options
context:
space:
mode:
authorValery Piashchynski <[email protected]>2021-07-14 19:11:29 +0300
committerValery Piashchynski <[email protected]>2021-07-14 19:11:29 +0300
commit3ce3b5a6e0839e31d2cfb3d3b6fa7f9c6ca2e0af (patch)
tree0f975f62cc60b8ab75c92691f08270242c36f311 /pkg/worker
parentcd07985494b3ebb03fd6553bed9aa1393052ffc5 (diff)
parent67db4b5f7b66e9a32713133baed83c3ab7146bb8 (diff)
Merge remote-tracking branch 'origin/master' into feature/jobs_plugin
# Conflicts: # pkg/worker_watcher/interface.go
Diffstat (limited to 'pkg/worker')
-rwxr-xr-xpkg/worker/sync_worker.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/pkg/worker/sync_worker.go b/pkg/worker/sync_worker.go
index 38f44461..380bfff7 100755
--- a/pkg/worker/sync_worker.go
+++ b/pkg/worker/sync_worker.go
@@ -60,6 +60,13 @@ func (tw *SyncWorkerImpl) Exec(p payload.Payload) (payload.Payload, error) {
return payload.Payload{}, errors.E(op, err)
}
+ // supervisor may set state of the worker during the work
+ // in this case we should not re-write the worker state
+ if tw.process.State().Value() != StateWorking {
+ tw.process.State().RegisterExec()
+ return rsp, nil
+ }
+
tw.process.State().Set(StateReady)
tw.process.State().RegisterExec()