Skip to content

Commit

Permalink
attempt to switch to ElasticSearch methods
Browse files Browse the repository at this point in the history
  • Loading branch information
qcampagn committed Nov 6, 2023
1 parent cd8fc37 commit 36f67d0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from DIRAC.Core.Base.AgentModule import AgentModule
from DIRAC.WorkloadManagementSystem.Client import JobStatus
from DIRAC.ConfigurationSystem.Client.Helpers.Operations import Operations
from DIRAC.WorkloadManagementSystem.Client.JobMonitoringClient import JobMonitoringClient
from DIRAC.WorkloadManagementSystem.Client.JobStateUpdateClient import JobStateUpdateClient
from DIRAC.WorkloadManagementSystem.DB.JobLoggingDB import JobLoggingDB

Expand All @@ -20,15 +21,17 @@ def __init__(self, *args, **kwargs):
"""
AgentModule.__init__(self, *args, **kwargs)

self.jobDB = None
self.jobMonitor = None
self.jobUpdate = None
self.logDB = None

#############################################################################
def initialize(self):
"""Sets defaults
"""

self.jobDB = JobStateUpdateClient()
self.jobMonitor = JobMonitoringClient()
self.jobUpdate = JobStateUpdateClient()
self.logDB = JobLoggingDB()

return S_OK()
Expand Down Expand Up @@ -62,7 +65,7 @@ def beginExecution(self):
def execute(self):
"""The ScoutingJobStatus execution method.
"""
result = self.jobDB.selectJobs({'Status': 'Scouting'})
result = self.jobMonitor.getJobs({'Status': 'Scouting'})
if not result['OK']:
return result

Expand Down
1 change: 0 additions & 1 deletion src/DIRAC/WorkloadManagementSystem/Executor/Scouting.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ def __setScoutingStatus(self, jobState=None):
if not jobState:
jobState = self.__jobData.jobState

result = jobState.getStatus()
if not (result := jobState.getStatus())['OK']:
return result

Expand Down

0 comments on commit 36f67d0

Please sign in to comment.