Skip to content

Commit

Permalink
fix: do not add JobStatus to JobParameters
Browse files Browse the repository at this point in the history
  • Loading branch information
fstagni committed Jun 27, 2024
1 parent 8e98e80 commit c9336a7
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions src/DIRAC/WorkloadManagementSystem/Utilities/JobStatusUtility.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -21,7 +20,6 @@ def __init__(
self,
jobDB: JobDB = None,
jobLoggingDB: JobLoggingDB = None,
elasticJobParametersDB: JobParametersDB = None,
) -> None:
"""
:raises: RuntimeError, AttributeError
Expand All @@ -31,7 +29,6 @@ def __init__(

self.jobDB = jobDB
self.jobLoggingDB = jobLoggingDB
self.elasticJobParametersDB = elasticJobParametersDB

if not self.jobDB:
try:
Expand All @@ -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
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit c9336a7

Please sign in to comment.