Skip to content

Commit c66fe35

Browse files
committed
refactor: remove the 'direct' option from JobAgent rescheduleFailedJob
1 parent 1d2a344 commit c66fe35

File tree

1 file changed

+7
-12
lines changed

1 file changed

+7
-12
lines changed

src/DIRAC/WorkloadManagementSystem/Agent/JobAgent.py

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -823,18 +823,13 @@ def _rescheduleFailedJob(self, jobID, message, direct=False):
823823

824824
self.log.warn("Failure ==> rescheduling", f"(during {message})")
825825

826-
if direct:
827-
JobStateUpdateClient().setJobStatus(
828-
int(jobID), status=JobStatus.RESCHEDULED, applicationStatus=message, source="JobAgent@%s", force=True
829-
)
830-
else:
831-
originalJobID = self.jobReport.jobID
832-
self.jobReport.setJob(jobID)
833-
# Setting a job parameter does not help since the job will be rescheduled,
834-
# instead set the status with the cause and then another status showing the
835-
# reschedule operation.
836-
self.jobReport.setJobStatus(status=JobStatus.RESCHEDULED, applicationStatus=message, sendFlag=True)
837-
self.jobReport.setJob(originalJobID)
826+
originalJobID = self.jobReport.jobID
827+
self.jobReport.setJob(jobID)
828+
# Setting a job parameter does not help since the job will be rescheduled,
829+
# instead set the status with the cause and then another status showing the
830+
# reschedule operation.
831+
self.jobReport.setJobStatus(status=JobStatus.RESCHEDULED, applicationStatus=message, sendFlag=True)
832+
self.jobReport.setJob(originalJobID)
838833

839834
self.log.info("Job will be rescheduled")
840835
result = JobManagerClient().rescheduleJob(jobID)

0 commit comments

Comments
 (0)