Browse Source

En cours de développement

master
losyme 2 months ago
parent
commit
47170618bc
  1. 2
      internal/storage/memory/next.go
  2. 7
      internal/storage/mongo/next.go

2
internal/storage/memory/next.go

@ -69,7 +69,7 @@ func (ms *memoryStorage) NextJob(namespace string, fn storage.SelectNextJob) (*j
}
job, err := fn(ms.jobsRunning(namespace), jtr)
if job == nil || err != nil {
if err != nil || job == nil {
return nil, err
}

7
internal/storage/mongo/next.go

@ -79,7 +79,7 @@ func (ms *mongoStorage) NextJob(namespace string, fn storage.SelectNextJob) (*jw
}
job, err := fn(jr, jtr)
if job == nil || err != nil {
if err != nil || job == nil {
return nil, err
}
@ -91,8 +91,11 @@ func (ms *mongoStorage) NextJob(namespace string, fn storage.SelectNextJob) (*jw
return job, nil
},
)
if err != nil || result == nil {
return nil, err
}
return result.(*jw.Job), err
return result.(*jw.Job), nil
}
/*

Loading…
Cancel
Save