diff --git a/docs/CHANGELOG.rst b/docs/CHANGELOG.rst index 51a57589f..358a8b957 100644 --- a/docs/CHANGELOG.rst +++ b/docs/CHANGELOG.rst @@ -14,6 +14,10 @@ Fix --- - Correctly clear ``Redis`` cache on data restart +Add +--- +- Add ``clear_redis_cache`` management command + =================== 38.2.0 - 2023-12-15 diff --git a/resolwe/flow/management/commands/clear_redis_cache.py b/resolwe/flow/management/commands/clear_redis_cache.py new file mode 100644 index 000000000..7e6b5e982 --- /dev/null +++ b/resolwe/flow/management/commands/clear_redis_cache.py @@ -0,0 +1,23 @@ +""".. Ignore pydocstyle D400. + +================= +Clear Redis Cache +================= + +Clear all the Redis Cache. +""" + + +from django.core.management.base import BaseCommand + +from resolwe.flow.managers.listener.redis_cache import redis_cache + + +class Command(BaseCommand): + """Run the executor listener.""" + + help = "Clear Redis cache." + + def handle(self, *args, **options): + """Clear the Redis cache.""" + redis_cache.clear()