2016-11-01 11:26:38 +01:00
|
|
|
from typing import Any
|
|
|
|
|
|
|
|
from django.core.management.base import BaseCommand
|
2023-10-12 19:43:45 +02:00
|
|
|
from typing_extensions import override
|
2020-01-14 21:59:46 +01:00
|
|
|
|
2024-04-23 21:30:37 +02:00
|
|
|
from zerver.lib.management import abort_unless_locked
|
2019-06-27 16:48:07 +02:00
|
|
|
from zerver.lib.retention import archive_messages, clean_archived_data
|
2016-11-01 11:26:38 +01:00
|
|
|
|
|
|
|
|
|
|
|
class Command(BaseCommand):
|
2023-10-12 19:43:45 +02:00
|
|
|
@override
|
2024-04-23 21:30:37 +02:00
|
|
|
@abort_unless_locked
|
2016-11-01 11:26:38 +01:00
|
|
|
def handle(self, *args: Any, **options: str) -> None:
|
2019-06-27 16:48:07 +02:00
|
|
|
clean_archived_data()
|
2016-11-01 11:26:38 +01:00
|
|
|
archive_messages()
|