Browse Source

En cours de développement

master
losyme 2 months ago
parent
commit
73a49d4f18
  1. 2
      go.mod
  2. 4
      go.sum
  3. 11
      workers/worker.go

2
go.mod

@ -3,7 +3,7 @@ module forge.chapril.org/dune/sdk
go 1.17
require (
forge.chapril.org/dune/jw v0.0.0-20220513133625-1bd989a0c40d
forge.chapril.org/dune/jw v0.0.0-20220513160554-916c2c844d36
forge.chapril.org/losyme/breaker v0.0.0-20220411170549-42dd8e90d60f
forge.chapril.org/losyme/errors v0.0.0-20220410175325-24ea6bde8500
forge.chapril.org/losyme/king v0.0.0-20220410175404-85e49de392ff

4
go.sum

@ -1,5 +1,5 @@
forge.chapril.org/dune/jw v0.0.0-20220513133625-1bd989a0c40d h1:5mR34KapWUB6Qr5+lO6YBYWy/uL5bCbrvcqmkDx86zw=
forge.chapril.org/dune/jw v0.0.0-20220513133625-1bd989a0c40d/go.mod h1:eyBPWS4xu8yjh9oqGaJah3kQe+0i/MssMQmnzke1Tf4=
forge.chapril.org/dune/jw v0.0.0-20220513160554-916c2c844d36 h1:NlZDAvecT2aoq1MO31fWygm0xrew0QXQqKQyLpT13a8=
forge.chapril.org/dune/jw v0.0.0-20220513160554-916c2c844d36/go.mod h1:eyBPWS4xu8yjh9oqGaJah3kQe+0i/MssMQmnzke1Tf4=
forge.chapril.org/losyme/breaker v0.0.0-20220411170549-42dd8e90d60f h1:fmwm3agM1q8e+WAF3G3RGsegXnu4RG/DFHIIEYWXXNw=
forge.chapril.org/losyme/breaker v0.0.0-20220411170549-42dd8e90d60f/go.mod h1:1vBH8Q+vML8EBZj1Pvcpzxx+eEBK+f24QzcXT5Bo+MY=
forge.chapril.org/losyme/buffer v0.0.0-20220410175226-b131a708418a h1:3f2hxFLAxRSxa0QZGlk7+3Zvk8hDYfyzBh3Y/qyVXh8=

11
workers/worker.go

@ -8,6 +8,7 @@ package workers
import (
"context"
"errors"
"fmt"
"runtime/debug"
"time"
@ -104,6 +105,14 @@ func (w *worker) runJob(job *jw.Job) {
}()
if err := w.runner.Run(job); err != nil {
result := new(jw.Result)
if errors.As(err, &result) {
job.Result = result
} else {
job.Failed().SetError(err.Error())
}
if w.logger != nil {
w.logger.Error( //::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
"RUN",
@ -112,8 +121,6 @@ func (w *worker) runJob(job *jw.Job) {
nil, err,
)
}
job.Failed().SetError(err.Error())
}
}

Loading…
Cancel
Save