Browse Source

En cours de développement

master
losyme 7 months ago
parent
commit
0d1c7f453a
  1. 9
      workers/worker.go

9
workers/worker.go

@ -15,6 +15,11 @@ import (
"forge.chapril.org/losyme/uuid"
)
const (
_timeoutOnError = 9 * time.Second
_timeoutNoJob = 3 * time.Second
)
type worker struct {
id string
host string
@ -91,11 +96,11 @@ func (w *worker) maybeRunJob() time.Duration {
job, err := w.runner.Model().NextJob(w.runner.Namespace())
if err != nil {
return 9 * time.Second
return _timeoutOnError
}
if job == nil {
return 1 * time.Second
return _timeoutNoJob
}
jobs := w.dashboard.addJob(w.id, job)

Loading…
Cancel
Save