File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
src/DIRAC/WorkloadManagementSystem/Agent Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change 9
9
"""
10
10
import datetime
11
11
12
- from DIRAC import S_OK , S_ERROR
12
+ from DIRAC import S_ERROR , S_OK
13
+ from DIRAC .AccountingSystem .Client .DataStoreClient import DataStoreClient
14
+ from DIRAC .AccountingSystem .Client .Types .WMSHistory import WMSHistory
13
15
from DIRAC .ConfigurationSystem .Client .Helpers .Operations import Operations
14
16
from DIRAC .Core .Base .AgentModule import AgentModule
15
17
from DIRAC .Core .Utilities import TimeUtilities
16
- from DIRAC .AccountingSystem .Client .Types .WMSHistory import WMSHistory
17
- from DIRAC .AccountingSystem .Client .DataStoreClient import DataStoreClient
18
18
from DIRAC .MonitoringSystem .Client .MonitoringReporter import MonitoringReporter
19
19
from DIRAC .WorkloadManagementSystem .DB .JobDB import JobDB
20
20
from DIRAC .WorkloadManagementSystem .DB .PilotAgentsDB import PilotAgentsDB
@@ -76,6 +76,12 @@ def initialize(self):
76
76
77
77
def execute (self ):
78
78
"""Main execution method"""
79
+
80
+ # on the first iteration of the agent, do nothing in order to avoid double committing after a restart
81
+ if self .am_getModuleParam ("cyclesDone" ) == 0 :
82
+ self .log .notice ("Skipping the first iteration of the agent" )
83
+ return S_OK ()
84
+
79
85
# PilotsHistory to Monitoring
80
86
if "Monitoring" in self .pilotMonitoringOption :
81
87
self .log .info ("Committing PilotsHistory to Monitoring" )
You can’t perform that action at this time.
0 commit comments