mirror of
https://github.com/zulip/zulip.git
synced 2025-11-05 22:43:42 +00:00
python: Catch BaseException when we need to clean something up.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
committed by
Tim Abbott
parent
7f69c1d3d5
commit
b7a94be152
@@ -53,7 +53,7 @@ def overwrite_symlink(src: str, dst: str) -> None:
|
|||||||
break
|
break
|
||||||
try:
|
try:
|
||||||
os.rename(tmp, dst)
|
os.rename(tmp, dst)
|
||||||
except Exception:
|
except BaseException:
|
||||||
os.remove(tmp)
|
os.remove(tmp)
|
||||||
raise
|
raise
|
||||||
|
|
||||||
|
|||||||
@@ -167,7 +167,7 @@ class SimpleQueueClient:
|
|||||||
try:
|
try:
|
||||||
callback(events)
|
callback(events)
|
||||||
channel.basic_ack(max_processed, multiple=True)
|
channel.basic_ack(max_processed, multiple=True)
|
||||||
except Exception:
|
except BaseException:
|
||||||
channel.basic_nack(max_processed, multiple=True)
|
channel.basic_nack(max_processed, multiple=True)
|
||||||
raise
|
raise
|
||||||
events = []
|
events = []
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ class Command(BaseCommand):
|
|||||||
logging.info("Thread %s processing %s", options['thread'], output_path)
|
logging.info("Thread %s processing %s", options['thread'], output_path)
|
||||||
try:
|
try:
|
||||||
export_usermessages_batch(locked_path, output_path, options["consent_message_id"])
|
export_usermessages_batch(locked_path, output_path, options["consent_message_id"])
|
||||||
except Exception:
|
except BaseException:
|
||||||
# Put the item back in the free pool when we fail
|
# Put the item back in the free pool when we fail
|
||||||
os.rename(locked_path, partial_path)
|
os.rename(locked_path, partial_path)
|
||||||
raise
|
raise
|
||||||
|
|||||||
Reference in New Issue
Block a user