Browse Source

En cours de développement

master
losyme 1 month ago
parent
commit
1b69f83278
  1. 4
      go.mod
  2. 8
      go.sum
  3. 2
      internal/model/validate.go
  4. 4
      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-20220513121951-5573e99f1c3c
forge.chapril.org/dune/sdk v0.0.0-20220513122008-c1038a55beec
forge.chapril.org/dune/jw v0.0.0-20220513133625-1bd989a0c40d
forge.chapril.org/dune/sdk v0.0.0-20220513133641-927bad90654a
forge.chapril.org/losyme/application v0.0.0-20220510163706-4966ce5cf3a9
forge.chapril.org/losyme/cmdline v0.0.0-20220510163732-022916fbda75
forge.chapril.org/losyme/config v0.0.0-20220513081712-b0ace6b263d2

8
go.sum

@ -1,7 +1,7 @@
forge.chapril.org/dune/jw v0.0.0-20220513121951-5573e99f1c3c h1:kBZ6UIOzDrlPv4cKeQNnWZZYJ7FgNN6cFOzPS7brscQ=
forge.chapril.org/dune/jw v0.0.0-20220513121951-5573e99f1c3c/go.mod h1:eyBPWS4xu8yjh9oqGaJah3kQe+0i/MssMQmnzke1Tf4=
forge.chapril.org/dune/sdk v0.0.0-20220513122008-c1038a55beec h1:kmTPnrg17w+RsqT71/QRsJ0zcvjSfbr1gDcuG09/Ke4=
forge.chapril.org/dune/sdk v0.0.0-20220513122008-c1038a55beec/go.mod h1:5BCBbZP5pk/13/776ymKLLTxwG8MrcQrH5VmBvxMfeU=
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/sdk v0.0.0-20220513133641-927bad90654a h1:V+SeEl9OEWlIedVEeMmmAFROJ2lrPsmgQBmO6FhnR8s=
forge.chapril.org/dune/sdk v0.0.0-20220513133641-927bad90654a/go.mod h1:ACDbqT+eA5rXcnEhd4+Y5hBjhnNNmukkxf0FStF+/SE=
forge.chapril.org/losyme/application v0.0.0-20220510163706-4966ce5cf3a9 h1:gOJRr5a58VwODhLrhPIxbN/4OrcR4Bz2T8RXdVMsaVY=
forge.chapril.org/losyme/application v0.0.0-20220510163706-4966ce5cf3a9/go.mod h1:Xs/0OhJj4/bdURwobmt3alDdfF1lyvcE51k98d0LmOw=
forge.chapril.org/losyme/breaker v0.0.0-20220411170549-42dd8e90d60f/go.mod h1:1vBH8Q+vML8EBZj1Pvcpzxx+eEBK+f24QzcXT5Bo+MY=

2
internal/model/validate.go

@ -62,10 +62,12 @@ func (m *model) validateJob(job *jw.Job) error {
validatePriority(&job.Priority)
// @FIXME: nécessaire ?
if job.Public == nil {
job.Public = make(map[string]interface{})
}
// @FIXME: nécessaire ?
if job.Private == nil {
job.Private = make(map[string]interface{})
}

4
internal/model/workflows.go

@ -33,7 +33,7 @@ func (m *model) stepToJob(wf *jw.Workflow, name string) (*jw.Job, error) {
SetMaxOccurrences(step.MaxOccurrences).
SetMaxAttempts(step.MaxAttempts)
job.Private = util.CopyKV(step.Config, job.Private)
job.Config = step.Config
job.Workflow = &wf.ID
job.CreatedAt = time.Now()
job.Status = jw.StatusTodo
@ -179,8 +179,8 @@ func (m *model) nextJob(wf *jw.Workflow, job *jw.Job, stepName string, data map[
return nil, err
}
nextJob.Config = util.CopyKV(data, nextJob.Config)
nextJob.Public = job.Public
nextJob.Private = util.CopyKV(data, nextJob.Private)
nextJob.ErrorCounter = job.ErrorCounter
nextJob.LastError = job.LastError

Loading…
Cancel
Save