Allow jobs to be submitted in paused status #104322

Merged
David Zhang merged 3 commits from David-Zhang-10/flamenco:submit-as-paused into main 2024-07-11 17:08:27 +02:00
Showing only changes of commit 00848a3755 - Show all commits

View File

@ -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")