File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed
packages/apps/job-launcher/server/src Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ export enum ErrorJob {
1313 JobParamsValidationFailed = 'Job parameters validation failed' ,
1414 InvalidEventType = 'Invalid event type' ,
1515 InvalidStatusCancellation = 'Job has an invalid status for cancellation' ,
16+ InvalidStatusCompletion = 'Job has an invalid status for completion' ,
1617 NotLaunched = 'Not launched' ,
1718 TaskDataNotFound = 'Task data not found' ,
1819 HCaptchaInvalidJobType = 'hCaptcha invalid job type' ,
Original file line number Diff line number Diff line change @@ -1731,8 +1731,14 @@ export class JobService {
17311731 if ( jobEntity . status === JobStatus . COMPLETED ) {
17321732 return ;
17331733 }
1734- if ( jobEntity . status !== JobStatus . LAUNCHED ) {
1735- throw new ControlledError ( ErrorJob . NotLaunched , HttpStatus . CONFLICT ) ;
1734+ if (
1735+ jobEntity . status !== JobStatus . LAUNCHED &&
1736+ jobEntity . status !== JobStatus . PARTIAL
1737+ ) {
1738+ throw new ControlledError (
1739+ ErrorJob . InvalidStatusCompletion ,
1740+ HttpStatus . CONFLICT ,
1741+ ) ;
17361742 }
17371743
17381744 jobEntity . status = JobStatus . COMPLETED ;
You can’t perform that action at this time.
0 commit comments