@@ -173,7 +173,7 @@ class BaseInterface(Interface):
173
173
_additional_metadata = []
174
174
_redirect_x = False
175
175
_references = []
176
- resource_monitor = True # Enabled for this interface IFF enabled in the config
176
+ resource_monitor = None # Enabled for this interface IFF enabled in the config
177
177
_etelemetry_version_data = None
178
178
179
179
def __init__ (
@@ -202,9 +202,10 @@ def __init__(
202
202
self .inputs .trait_set (** inputs )
203
203
204
204
self .ignore_exception = ignore_exception
205
-
206
- if resource_monitor is not None :
207
- self .resource_monitor = resource_monitor
205
+ self .resource_monitor = (
206
+ resource_monitor if resource_monitor is not None
207
+ else config .resource_monitor
208
+ )
208
209
209
210
if from_file is not None :
210
211
self .load_inputs_from_json (from_file , overwrite = True )
@@ -376,18 +377,13 @@ def run(self, cwd=None, ignore_exception=None, **inputs):
376
377
if successful, results
377
378
378
379
"""
379
- rtc = RuntimeContext (
380
- resource_monitor = config .resource_monitor and self .resource_monitor ,
381
- ignore_exception = ignore_exception
382
- if ignore_exception is not None
383
- else self .ignore_exception ,
384
- )
385
380
386
381
with indirectory (cwd or os .getcwd ()):
387
382
self .inputs .trait_set (** inputs )
388
383
self ._check_mandatory_inputs ()
389
384
self ._check_version_requirements (self .inputs )
390
385
386
+ rtc = RuntimeContext ()
391
387
with rtc (self , cwd = cwd , redirect_x = self ._redirect_x ) as runtime :
392
388
393
389
# Grab inputs now, as they should not change during execution
0 commit comments