Skip to content

Commit 45bf641

Browse files
authored
More fixes for dax manager REDCap issues (#499)
Update dax_manager to use cached data from instance settings redcap project
1 parent 3fa1b08 commit 45bf641

File tree

2 files changed

+5
-12
lines changed

2 files changed

+5
-12
lines changed

dax/dax_manager.py

+4-6
Original file line numberDiff line numberDiff line change
@@ -534,9 +534,7 @@ def set_last_build_start(self, project):
534534
response = self._redcap.import_records([rec])
535535
assert 'count' in response
536536
except Exception as e:
537-
err = 'redcap import failed'
538-
LOGGER.info(err)
539-
LOGGER.info(e)
537+
LOGGER.info(f'REDCap import failed:{e}')
540538
except AssertionError as e:
541539
err = 'redcap import failed'
542540
LOGGER.info(e)
@@ -825,7 +823,7 @@ def run(self):
825823
LOGGER.info(f'rcq update:{_projects}')
826824
rcq.update(
827825
self._rcq,
828-
self._redcap,
826+
self.settings_manager._instance_settings,
829827
build_enabled=False,
830828
launch_enabled=self.is_enabled_launch(),
831829
projects=_projects)
@@ -910,7 +908,7 @@ def run(self):
910908
def rcq_update(self):
911909
rcq.update(
912910
self._rcq,
913-
self._redcap,
911+
self.settings_manager._instance_settings,
914912
build_enabled=False,
915913
launch_enabled=self.is_enabled_launch(),
916914
projects=self.settings_manager.project_names())
@@ -954,7 +952,7 @@ def run_rcq_build(self, projects):
954952
LOGGER.warn(f'failed to get lock, cannot build rcq:{lock_file}')
955953
return []
956954

957-
instance_settings = rcq._load_instance_settings(self._redcap)
955+
instance_settings = self.settings_manager._instance_settings
958956
yaml_dir = instance_settings['main_processorlib']
959957
with get_interface(host=self.xnat_host) as xnat:
960958
builder = rcq.TaskBuilder(self._rcq, xnat, yaml_dir)

dax/rcq/__init__.py

+1-6
Original file line numberDiff line numberDiff line change
@@ -33,18 +33,13 @@
3333
# apply_updates()
3434

3535

36-
def update(rc, instances, build_enabled=True, launch_enabled=True, projects=None):
36+
def update(rc, instance_settings, build_enabled=True, launch_enabled=True, projects=None):
3737
logger.info('connecting to redcap')
3838
def_field = rc.def_field
3939

4040
if projects is None:
4141
projects = [x[def_field] for x in rc.export_records(fields=[def_field])]
4242

43-
instance_settings = _load_instance_settings(instances)
44-
if not instance_settings:
45-
logger.debug('no settings found for this instance')
46-
return
47-
4843
logger.debug(f'instance_settings={instance_settings}')
4944

5045
yamldir = instance_settings['main_processorlib']

0 commit comments

Comments
 (0)