Allow jobs to be submitted in paused
status
#104322
@ -91,8 +91,12 @@ func (f *Flamenco) SubmitJob(e echo.Context) error {
|
|||||||
|
|
||||||
logger = logger.With().Str("job_id", authoredJob.JobID).Logger()
|
logger = logger.With().Str("job_id", authoredJob.JobID).Logger()
|
||||||
|
|
||||||
// TODO: check whether this job should be queued immediately or start paused.
|
submittedJob := api.SubmittedJob(job)
|
||||||
authoredJob.Status = api.JobStatusQueued
|
initialStatus := api.JobStatusQueued
|
||||||
|
if submittedJob.InitialStatus != nil {
|
||||||
|
initialStatus = *submittedJob.InitialStatus
|
||||||
|
}
|
||||||
|
authoredJob.Status = initialStatus
|
||||||
|
|
||||||
if err := f.persist.StoreAuthoredJob(ctx, *authoredJob); err != nil {
|
if err := f.persist.StoreAuthoredJob(ctx, *authoredJob); err != nil {
|
||||||
logger.Error().Err(err).Msg("error persisting job in database")
|
logger.Error().Err(err).Msg("error persisting job in database")
|
||||||
|
Loading…
Reference in New Issue
Block a user