Browse Source

En cours de développement

master
losyme 5 months ago
parent
commit
5021e2b665
  1. 4
      go.mod
  2. 8
      go.sum
  3. 4
      internal/model/next.go
  4. 4
      internal/model/validate.go
  5. 2
      internal/model/workflows.go

4
go.mod

@ -3,8 +3,8 @@ module forge.chapril.org/dune/dune
go 1.17
require (
forge.chapril.org/dune/jw v0.0.0-20211213210604-c0f4a688af83
forge.chapril.org/dune/sdk v0.0.0-20211213224732-14790a495a76
forge.chapril.org/dune/jw v0.0.0-20211213225407-4cc900fc0c76
forge.chapril.org/dune/sdk v0.0.0-20211213225441-e57735da71e6
forge.chapril.org/losyme/application v0.0.0-20211213111117-a6146fdf5ab7
forge.chapril.org/losyme/cmdline v0.0.0-20211213111222-30a8a95006d4
forge.chapril.org/losyme/config v0.0.0-20211213111241-b0c3747bff28

8
go.sum

@ -1,7 +1,7 @@
forge.chapril.org/dune/jw v0.0.0-20211213210604-c0f4a688af83 h1:+4/N5eAQFG7yq7U20YidT6nXQ4v+BoQzIL/XVjeY08Q=
forge.chapril.org/dune/jw v0.0.0-20211213210604-c0f4a688af83/go.mod h1:7CyK2ZvzHntSlOZ7kWcqVhkmUzlE0QI3uKW9kPbNbOY=
forge.chapril.org/dune/sdk v0.0.0-20211213224732-14790a495a76 h1:U2hiV1wWNvKTcQKvFLJ4eoXKZ/k8u5/bvvlqLqtAdGc=
forge.chapril.org/dune/sdk v0.0.0-20211213224732-14790a495a76/go.mod h1:UJG9u+Eq0IGIf0HQpPZs+bChTBJRnxhd3+HCAxf9hHE=
forge.chapril.org/dune/jw v0.0.0-20211213225407-4cc900fc0c76 h1:Y6JKfcyJyy6jgGShTD87JhHox7R57QcThP5Jc9nTy0k=
forge.chapril.org/dune/jw v0.0.0-20211213225407-4cc900fc0c76/go.mod h1:7CyK2ZvzHntSlOZ7kWcqVhkmUzlE0QI3uKW9kPbNbOY=
forge.chapril.org/dune/sdk v0.0.0-20211213225441-e57735da71e6 h1:JhUsBwkXYBGDimVLoKU9lEt4GqtIoK2DF0ssnTNJ6zE=
forge.chapril.org/dune/sdk v0.0.0-20211213225441-e57735da71e6/go.mod h1:7+liknxUG25AZznEstXDcic6xWKAj7NMtixisq3Kggo=
forge.chapril.org/losyme/application v0.0.0-20211213111117-a6146fdf5ab7 h1:aOI2GnFFXdzRXxvDsggwS101uTVifxJDWUtkDQ6TBiI=
forge.chapril.org/losyme/application v0.0.0-20211213111117-a6146fdf5ab7/go.mod h1:TtemFqOtV5sLkkdouI1oKJJgBXSHyeGuBjiDKSahM6M=
forge.chapril.org/losyme/breaker v0.0.0-20211213111052-51eee5381368/go.mod h1:1vBH8Q+vML8EBZj1Pvcpzxx+eEBK+f24QzcXT5Bo+MY=

4
internal/model/next.go

@ -30,8 +30,8 @@ func selectNextJob(jr sdk.JobsRunning, jtr sdk.JobsToRun) (*jw.Job, error) {
}
}
if job.MaxOccurences > 0 {
if n, ok := jr[job.Type]; ok && n >= job.MaxOccurences {
if job.MaxOccurrences > 0 {
if n, ok := jr[job.Type]; ok && n >= job.MaxOccurrences {
continue
}
}

4
internal/model/validate.go

@ -78,8 +78,8 @@ func (m *model) validateJob(job *jw.Job) error {
job.MaxAttempts = 0
}
if job.MaxOccurences < 0 {
job.MaxOccurences = 0
if job.MaxOccurrences < 0 {
job.MaxOccurrences = 0
}
job.Workflow = nil

2
internal/model/workflows.go

@ -31,7 +31,7 @@ func (m *model) stepToJob(wf *jw.Workflow, name string) (*jw.Job, error) {
SetPriority(wf.Priority).
SetExclusivity(step.Exclusivity).
SetMaxAttempts(step.MaxAttempts).
SetMaxOccurences(step.MaxOccurences)
SetMaxOccurrences(step.MaxOccurrences)
util.CopyKV(step.Config, job.Private)

Loading…
Cancel
Save