diff --git a/src/DIRAC/Core/Utilities/TimeUtilities.py b/src/DIRAC/Core/Utilities/TimeUtilities.py index 4ffa926a11d..6dc969008c9 100755 --- a/src/DIRAC/Core/Utilities/TimeUtilities.py +++ b/src/DIRAC/Core/Utilities/TimeUtilities.py @@ -19,14 +19,12 @@ if a give datetime is in the defined interval. """ -import calendar -import time import datetime import sys +import time from DIRAC import gLogger - # Some useful constants for time operations microsecond = datetime.timedelta(microseconds=1) second = datetime.timedelta(seconds=1) diff --git a/src/DIRAC/WorkloadManagementSystem/Agent/StalledJobAgent.py b/src/DIRAC/WorkloadManagementSystem/Agent/StalledJobAgent.py index 0b4b3ffe0d7..f95b74021b8 100755 --- a/src/DIRAC/WorkloadManagementSystem/Agent/StalledJobAgent.py +++ b/src/DIRAC/WorkloadManagementSystem/Agent/StalledJobAgent.py @@ -13,20 +13,20 @@ import concurrent.futures import datetime -from DIRAC import S_OK, S_ERROR, gConfig +from DIRAC import S_ERROR, S_OK, gConfig from DIRAC.AccountingSystem.Client.Types.Job import Job +from DIRAC.ConfigurationSystem.Client.Helpers import cfgPath +from DIRAC.ConfigurationSystem.Client.PathFinder import getSystemInstance from DIRAC.Core.Base.AgentModule import AgentModule from DIRAC.Core.Utilities import DErrno -from DIRAC.Core.Utilities.TimeUtilities import fromString, toEpoch, second from DIRAC.Core.Utilities.ClassAd.ClassAdLight import ClassAd -from DIRAC.ConfigurationSystem.Client.Helpers import cfgPath -from DIRAC.ConfigurationSystem.Client.PathFinder import getSystemInstance -from DIRAC.WorkloadManagementSystem.Client.WMSClient import WMSClient +from DIRAC.Core.Utilities.TimeUtilities import fromString, second, toEpoch +from DIRAC.WorkloadManagementSystem.Client import JobMinorStatus, JobStatus from DIRAC.WorkloadManagementSystem.Client.JobMonitoringClient import JobMonitoringClient from DIRAC.WorkloadManagementSystem.Client.PilotManagerClient import PilotManagerClient +from DIRAC.WorkloadManagementSystem.Client.WMSClient import WMSClient from DIRAC.WorkloadManagementSystem.DB.JobDB import JobDB from DIRAC.WorkloadManagementSystem.DB.JobLoggingDB import JobLoggingDB -from DIRAC.WorkloadManagementSystem.Client import JobStatus, JobMinorStatus class StalledJobAgent(AgentModule): diff --git a/src/DIRAC/WorkloadManagementSystem/Client/Matcher.py b/src/DIRAC/WorkloadManagementSystem/Client/Matcher.py index 0ebec4d16a7..33fd28b0e95 100644 --- a/src/DIRAC/WorkloadManagementSystem/Client/Matcher.py +++ b/src/DIRAC/WorkloadManagementSystem/Client/Matcher.py @@ -250,7 +250,7 @@ def _reportStatus(self, resourceDict, jobID): """ attNames = ["Status", "MinorStatus", "ApplicationStatus", "Site"] attValues = ["Matched", "Assigned", "Unknown", resourceDict["Site"]] - result = self.jobDB.setJobAttributes(jobID, attNames, attValues) + result = self.jobDB.setJobAttributes(jobID, attNames, attValues, update=True) if not result["OK"]: self.log.error("Problem reporting job status", f"setJobAttributes, jobID = {jobID}: {result['Message']}") else: