@@ -317,6 +317,11 @@ def _authzMYAUTH(self):
317
317
encode = staticmethod (encode )
318
318
decode = staticmethod (decode )
319
319
320
+ # Class instance of monitoringReporter to use
321
+ # It is initialized in __initialize
322
+ # If it is set to False, do not instanciate it
323
+ activityMonitoringReporter = None
324
+
320
325
@classmethod
321
326
def __pre_initialize (cls ) -> list :
322
327
"""This method is run by the Tornado server to prepare the handler for launch,
@@ -477,8 +482,9 @@ def __initialize(cls, request):
477
482
478
483
cls .initializeHandler (cls ._componentInfoDict )
479
484
480
- cls .activityMonitoringReporter = None
481
- if "Monitoring" in Operations ().getMonitoringBackends (monitoringType = "ServiceMonitoring" ):
485
+ if cls .activityMonitoringReporter is not False and "Monitoring" in Operations ().getMonitoringBackends (
486
+ monitoringType = "ServiceMonitoring"
487
+ ):
482
488
from DIRAC .MonitoringSystem .Client .MonitoringReporter import MonitoringReporter
483
489
484
490
cls .activityMonitoringReporter = MonitoringReporter (monitoringType = "ServiceMonitoring" )
@@ -703,7 +709,7 @@ def on_finish(self):
703
709
"Location" : self .request .uri ,
704
710
"ResponseTime" : elapsedTime ,
705
711
# Take the method name from the POST call
706
- "MethodName" : self .request .arguments .get ("method" , ["Unknown" ])[0 ].decode (),
712
+ "MethodName" : self .request .arguments .get ("method" , [b "Unknown" ])[0 ].decode (),
707
713
"Protocol" : "https" ,
708
714
"Status" : monitoringRetStatus ,
709
715
}
0 commit comments