From 3acd76114b008806e8c58937b3c5fa27866ce984 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Vinot?= Date: Thu, 17 Oct 2024 14:10:44 +0200 Subject: [PATCH] chg: Allow to stop the archiver quicker --- bin/archiver.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/bin/archiver.py b/bin/archiver.py index 8d3d2b8a..94ff7f74 100755 --- a/bin/archiver.py +++ b/bin/archiver.py @@ -128,6 +128,9 @@ class Archiver(AbstractManager): rewrite_index = True current_sub_index.add(dir_on_disk.name) 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: # got a capture if len(self.s3fs_client.ls(entry, detail=False)) == 1: @@ -155,6 +158,9 @@ class Archiver(AbstractManager): rewrite_index = True current_sub_index.add(dir_on_disk.name) 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: # isoformat if str(dir_on_disk) not in current_index_dirs: