summaryrefslogtreecommitdiff
path: root/sync_worker.go
diff options
context:
space:
mode:
authorWolfy-J <[email protected]>2020-10-26 21:46:23 +0300
committerWolfy-J <[email protected]>2020-10-26 21:46:23 +0300
commit2176584129e493e08aed158bc050070d520ee183 (patch)
tree0d4664ef76ff6515fa965690a79dc69604eb3849 /sync_worker.go
parent9d2de5e46110c07eceb87dcfde3af9b6a6c4a76c (diff)
- implement worker debug mode
Diffstat (limited to 'sync_worker.go')
-rwxr-xr-xsync_worker.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/sync_worker.go b/sync_worker.go
index d7c15e88..2f3eb1e4 100755
--- a/sync_worker.go
+++ b/sync_worker.go
@@ -18,7 +18,7 @@ type SyncWorker interface {
WorkerBase
// Exec used to execute payload on the SyncWorker, there is no TIMEOUTS
- Exec(rqs Payload) (Payload, error)
+ Exec(p Payload) (Payload, error)
}
type syncWorker struct {
@@ -47,7 +47,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()
}
@@ -60,13 +60,13 @@ func (tw *syncWorker) Exec(p Payload) (Payload, error) {
return rsp, nil
}
-func (tw *syncWorker) execPayload(rqs Payload) (Payload, error) {
+func (tw *syncWorker) execPayload(p Payload) (Payload, error) {
// 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.Wrap(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.Wrap(err, "sender error")
}
@@ -83,7 +83,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 :)