management: Add lockfiles to all _once management jobs.

These would be bad if more than once ran at once.
This commit is contained in:
Alex Vandiver
2024-04-23 19:30:37 +00:00
committed by Tim Abbott
parent 11dd6791c4
commit e8e6abdbba
8 changed files with 16 additions and 5 deletions

View File

@@ -3,7 +3,7 @@ from typing import Any, Iterable
from django.core.management.base import CommandParser
from typing_extensions import override
from zerver.lib.management import ZulipBaseCommand
from zerver.lib.management import ZulipBaseCommand, abort_unless_locked
from zerver.lib.message import maybe_update_first_visible_message_id
from zerver.models import Realm
@@ -23,6 +23,7 @@ class Command(ZulipBaseCommand):
)
@override
@abort_unless_locked
def handle(self, *args: Any, **options: Any) -> None:
target_realm = self.get_realm(options)