chg: Allow to stop the archiver quicker

pull/963/head
Raphaël Vinot 2024-10-17 14:10:44 +02:00
parent 885e93936b
commit 3acd76114b
1 changed files with 6 additions and 0 deletions

View File

@ -128,6 +128,9 @@ class Archiver(AbstractManager):
rewrite_index = True rewrite_index = True
current_sub_index.add(dir_on_disk.name) current_sub_index.add(dir_on_disk.name)
self.logger.info(f'Adding sub index {dir_on_disk.name} to {index_file}') self.logger.info(f'Adding sub index {dir_on_disk.name} to {index_file}')
if self.shutdown_requested():
self.logger.warning('Shutdown requested, breaking.')
break
else: else:
# got a capture # got a capture
if len(self.s3fs_client.ls(entry, detail=False)) == 1: if len(self.s3fs_client.ls(entry, detail=False)) == 1:
@ -155,6 +158,9 @@ class Archiver(AbstractManager):
rewrite_index = True rewrite_index = True
current_sub_index.add(dir_on_disk.name) current_sub_index.add(dir_on_disk.name)
self.logger.info(f'Adding sub index {dir_on_disk.name} to {index_file}') self.logger.info(f'Adding sub index {dir_on_disk.name} to {index_file}')
if self.shutdown_requested():
self.logger.warning('Shutdown requested, breaking.')
break
else: else:
# isoformat # isoformat
if str(dir_on_disk) not in current_index_dirs: if str(dir_on_disk) not in current_index_dirs: