From c9336a7e8a42b3136427c5cf89b9dbdf859b9bf6 Mon Sep 17 00:00:00 2001 From: Federico Stagni Date: Thu, 27 Jun 2024 13:51:05 +0200 Subject: [PATCH] fix: do not add JobStatus to JobParameters --- .../Utilities/JobStatusUtility.py | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/src/DIRAC/WorkloadManagementSystem/Utilities/JobStatusUtility.py b/src/DIRAC/WorkloadManagementSystem/Utilities/JobStatusUtility.py index 1440d86bd1a..ebdd0e76546 100644 --- a/src/DIRAC/WorkloadManagementSystem/Utilities/JobStatusUtility.py +++ b/src/DIRAC/WorkloadManagementSystem/Utilities/JobStatusUtility.py @@ -11,7 +11,6 @@ from DIRAC.WorkloadManagementSystem.Client import JobStatus if TYPE_CHECKING: - from DIRAC.WorkloadManagementSystem.DB.JobParametersDB import JobParametersDB from DIRAC.WorkloadManagementSystem.DB.JobDB import JobDB from DIRAC.WorkloadManagementSystem.DB.JobLoggingDB import JobLoggingDB @@ -21,7 +20,6 @@ def __init__( self, jobDB: JobDB = None, jobLoggingDB: JobLoggingDB = None, - elasticJobParametersDB: JobParametersDB = None, ) -> None: """ :raises: RuntimeError, AttributeError @@ -31,7 +29,6 @@ def __init__( self.jobDB = jobDB self.jobLoggingDB = jobLoggingDB - self.elasticJobParametersDB = elasticJobParametersDB if not self.jobDB: try: @@ -53,11 +50,6 @@ def __init__( self.log.error("Can't connect to the JobLoggingDB") raise - if not self.elasticJobParametersDB: - result = ObjectLoader().loadObject("WorkloadManagementSystem.DB.JobParametersDB", "JobParametersDB") - if not result["OK"]: - raise AttributeError(result["Message"]) - self.elasticJobParametersDB = result["Value"](parentLogger=self.log) def setJobStatus( self, jobID: int, status=None, minorStatus=None, appStatus=None, source=None, dateTime=None, force=False @@ -154,10 +146,7 @@ def setJobStatusBulk(self, jobID: int, statusDict: dict, force: bool = False): result = self.jobDB.setJobAttributes(jobID, attrNames, attrValues, update=True, force=True) if not result["OK"]: return result - if self.elasticJobParametersDB: - result = self.elasticJobParametersDB.setJobParameter(int(jobID), "Status", status) - if not result["OK"]: - return result + # Update start and end time if needed if not endTime and newEndTime: log.debug("Set job end time", endTime)