File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
src/DIRAC/WorkloadManagementSystem/Agent Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -750,6 +750,11 @@ def _monitorPilotsPerQueue(self, queue: str):
750750 ceType = self .queueDict [queue ]["CEType" ]
751751 siteName = self .queueDict [queue ]["Site" ]
752752
753+ # Call cleanup before checking pilot statuses (so cleanup always runs)
754+ # This is needed to delete things like old cloud instances after the pilots are done
755+ if callable (getattr (ce , "cleanupPilots" , None )):
756+ ce .cleanupPilots ()
757+
753758 # Select pilots in a transient states
754759 result = self .pilotAgentsDB .selectPilots (
755760 {
@@ -799,10 +804,6 @@ def _monitorPilotsPerQueue(self, queue: str):
799804 # Update the status of the pilots in the DB
800805 self ._updatePilotsInDB (updatedPilots )
801806
802- # FIXME: seems like it is only used by the CloudCE? Couldn't it be called from CloudCE.getJobStatus()?
803- if callable (getattr (ce , "cleanupPilots" , None )):
804- ce .cleanupPilots ()
805-
806807 # Check if the accounting is to be sent
807808 if self .sendAccounting :
808809 result = self .pilotAgentsDB .selectPilots (
You can’t perform that action at this time.
0 commit comments