mirror of
https://github.com/zulip/zulip.git
synced 2025-11-03 13:33:24 +00:00
management: Add lockfiles to all _once management jobs.
These would be bad if more than once ran at once.
This commit is contained in:
committed by
Tim Abbott
parent
11dd6791c4
commit
e8e6abdbba
@@ -8,6 +8,7 @@ from typing_extensions import override
|
||||
|
||||
from zerver.actions.uploads import do_delete_old_unclaimed_attachments
|
||||
from zerver.lib.attachments import get_old_unclaimed_attachments
|
||||
from zerver.lib.management import abort_unless_locked
|
||||
from zerver.lib.upload import all_message_attachments, delete_message_attachments
|
||||
from zerver.models import ArchivedAttachment, Attachment
|
||||
|
||||
@@ -44,6 +45,7 @@ class Command(BaseCommand):
|
||||
)
|
||||
|
||||
@override
|
||||
@abort_unless_locked
|
||||
def handle(self, *args: Any, **options: Any) -> None:
|
||||
delta_weeks = options["delta_weeks"]
|
||||
print(f"Deleting unclaimed attached files older than {delta_weeks} weeks")
|
||||
|
||||
Reference in New Issue
Block a user