bookwyrm-mastodon/bookwyrm/management/commands/erase_streams.py

25 lines
589 B
Python
Raw Normal View History

""" Delete user streams """
from django.core.management.base import BaseCommand
import redis
from bookwyrm import settings
r = redis.Redis(
2022-01-12 21:44:11 -05:00
host=settings.REDIS_ACTIVITY_HOST, port=settings.REDIS_ACTIVITY_PORT, db=settings.REDIS_ACTIVITY_DB
)
def erase_streams():
2021-04-26 12:15:42 -04:00
"""throw the whole redis away"""
r.flushall()
2021-03-28 14:51:02 -04:00
class Command(BaseCommand):
2021-04-26 12:15:42 -04:00
"""delete activity streams for all users"""
help = "Delete all the user streams"
# pylint: disable=no-self-use,unused-argument
def handle(self, *args, **options):
2021-04-26 12:15:42 -04:00
"""flush all, baby"""
erase_streams()