/usr/lib/python2.7/dist-packages/kombu/transport/django/management/commands/clean_kombu_messages.py is in python-kombu 3.0.35-1.1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | from __future__ import absolute_import
from django.core.management.base import BaseCommand
def pluralize(desc, value):
if value > 1:
return desc + 's'
return desc
class Command(BaseCommand):
requires_model_validation = True
def handle(self, *args, **options):
from kombu.transport.django.models import Message
count = Message.objects.filter(visible=False).count()
print('Removing {0} invisible {1} from database... '.format(
count, pluralize('message', count)))
Message.objects.cleanup()
|