WIP: Allow jobs to be submitted in paused
status
#104318
@ -18,5 +18,6 @@ curl -X 'POST' \
|
||||
"message": "Blender is {blender}"
|
||||
},
|
||||
"type": "echo-sleep-test",
|
||||
"submitter_platform": "manager"
|
||||
"submitter_platform": "manager",
|
||||
"initial_status": "paused"
|
||||
|
||||
}'
|
||||
|
@ -92,7 +92,9 @@ func (f *Flamenco) SubmitJob(e echo.Context) error {
|
||||
logger = logger.With().Str("job_id", authoredJob.JobID).Logger()
|
||||
|
||||
// TODO: check whether this job should be queued immediately or start paused.
|
||||
Sybren A. Stüvel
commented
This TODO can now be removed. This TODO can now be removed.
|
||||
if authoredJob.Status == api.JobStatusUnderConstruction {
|
||||
authoredJob.Status = api.JobStatusQueued
|
||||
}
|
||||
|
||||
if err := f.persist.StoreAuthoredJob(ctx, *authoredJob); err != nil {
|
||||
logger.Error().Err(err).Msg("error persisting job in database")
|
||||
|
@ -131,6 +131,10 @@ func (s *Service) Compile(ctx context.Context, sj api.SubmittedJob) (*AuthoredJo
|
||||
aj.WorkerTagUUID = *sj.WorkerTag
|
||||
}
|
||||
|
||||
if sj.InitialStatus != nil {
|
||||
aj.Status = *sj.InitialStatus
|
||||
Sybren A. Stüvel
commented
What's the reason to handle this here, rather than in What's the reason to handle this here, rather than in `func (f *Flamenco) SubmitJob(e echo.Context) error`? I think it's better to keep the status as `under-construction` while the job is still under construction, and then let it go to its initial status afterwards (like the current `under-construction` → `queued` transition).
|
||||
}
|
||||
|
||||
compiler, err := vm.getCompileJob()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@ -144,6 +148,7 @@ func (s *Service) Compile(ctx context.Context, sj api.SubmittedJob) (*AuthoredJo
|
||||
Str("name", aj.Name).
|
||||
Str("jobtype", aj.JobType).
|
||||
Str("job", aj.JobID).
|
||||
Str("status", string(aj.Status)).
|
||||
Msg("job compiled")
|
||||
|
||||
return &aj, nil
|
||||
|
Loading…
Reference in New Issue
Block a user
Change this to
queued
so that the semantics of the script don't change.For these kind of "I need a slightly different script" cases, I ususally just make a copy, then add its filename to
.git/info/exclude
so I don't accidentally commit it.