summaryrefslogtreecommitdiff
path: root/sync_worker.go
diff options
context:
space:
mode:
authorValery Piashchynski <[email protected]>2020-10-27 15:58:46 +0300
committerValery Piashchynski <[email protected]>2020-10-27 15:58:46 +0300
commitc9af916ae4d78334d348ed1ef7238206f3ecb7a1 (patch)
tree43c04f7c538ecbd0b29fc280d41df5d00f203436 /sync_worker.go
parentfd60aff1cddf32b0c45d934fcf14b070df80adcf (diff)
parent105bde0e0c1a7c133d1daa10603ca5ce9a9ade4d (diff)
Merge remote-tracking branch 'origin/release_2.0' into feature/pool_supervisor
# Conflicts: # static_pool.go # sync_worker.go
Diffstat (limited to 'sync_worker.go')
-rwxr-xr-xsync_worker.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/sync_worker.go b/sync_worker.go
index 31d68168..6dd8d8e8 100755
--- a/sync_worker.go
+++ b/sync_worker.go
@@ -49,7 +49,7 @@ func (tw *syncWorker) Exec(p Payload) (Payload, error) {
rsp, err := tw.execPayload(p)
if err != nil {
- if _, ok := err.(JobError); !ok {
+ if _, ok := err.(ExecError); !ok {
tw.w.State().Set(StateErrored)
tw.w.State().RegisterExec()
}
@@ -129,14 +129,14 @@ func (tw *syncWorker) ExecWithContext(ctx context.Context, p Payload) (Payload,
}
}
-func (tw *syncWorker) execPayload(rqs Payload) (Payload, error) {
+func (tw *syncWorker) execPayload(p Payload) (Payload, error) {
const op = errors.Op("exec_payload")
// two things; todo: merge
- if err := sendControl(tw.w.Relay(), rqs.Context); err != nil {
+ if err := sendControl(tw.w.Relay(), p.Context); err != nil {
return EmptyPayload, errors.E(op, err, "header error")
}
- if err := tw.w.Relay().Send(rqs.Body, 0); err != nil {
+ if err := tw.w.Relay().Send(p.Body, 0); err != nil {
return EmptyPayload, errors.E(op, err, "sender error")
}
@@ -153,7 +153,7 @@ func (tw *syncWorker) execPayload(rqs Payload) (Payload, error) {
}
if pr.HasFlag(goridge.PayloadError) {
- return EmptyPayload, JobError(rsp.Context)
+ return EmptyPayload, ExecError(rsp.Context)
}
// add streaming support :)