mirror of https://github.com/zulip/zulip.git
Implement a command to expunge old UserMessages and Messages from the database
(imported from commit a4873dfa8737c483411d12f30daaebebebf859f9)
This commit is contained in:
parent
c8b6e72cbf
commit
3715583d29
|
@ -0,0 +1,11 @@
|
|||
from django.core.management.base import BaseCommand
|
||||
from zephyr.retention_policy import get_UserMessages_to_expunge
|
||||
from zephyr.models import Message
|
||||
|
||||
class Command(BaseCommand):
|
||||
help = ('Expunge old UserMessages and Messages from the database, '
|
||||
+ 'according to the retention policy.')
|
||||
|
||||
def handle(self, *args, **kwargs):
|
||||
get_UserMessages_to_expunge().delete()
|
||||
Message.remove_unreachable()
|
Loading…
Reference in New Issue