Skip to content

Commit

Permalink
Fix startup directory clean (#926)
Browse files Browse the repository at this point in the history
  • Loading branch information
grafnu authored Sep 27, 2021
1 parent c915538 commit de55ccc
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions daq/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,10 +243,13 @@ def _init_daq_run_id(self):

def _cleanup_previous_runs(self):
if os.path.isdir(report.REPORT_BASE_DIR):
LOGGER.info('Removing existing %s', report.REPORT_BASE_DIR)
shutil.rmtree(report.REPORT_BASE_DIR, ignore_errors=True)
for path in os.listdir(DAQ_RUN_DIR):
if path.startswith(connected_host.DEV_DIR_PREFIX) and os.path.isdir(path):
shutil.rmtree(path, ignore_errors=True)
fullpath = os.path.join(DAQ_RUN_DIR, path)
if path.startswith(connected_host.DEV_DIR_PREFIX) and os.path.isdir(fullpath):
LOGGER.info('Removing existing %s', fullpath)
shutil.rmtree(fullpath, ignore_errors=True)

def _init_device_result_handler(self):
server_port = self.config.get('device_reporting', {}).get('server_port')
Expand Down

0 comments on commit de55ccc

Please sign in to comment.