From 84d003e2e0864bd0e24b29eb011720fb9f2f93e0 Mon Sep 17 00:00:00 2001 From: Gabriel Augendre Date: Sun, 2 Apr 2023 18:33:43 +0200 Subject: [PATCH] Add refresh cache command --- src/purchase/management/commands/refresh_cache.py | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 src/purchase/management/commands/refresh_cache.py diff --git a/src/purchase/management/commands/refresh_cache.py b/src/purchase/management/commands/refresh_cache.py new file mode 100644 index 0000000..2e9ecc2 --- /dev/null +++ b/src/purchase/management/commands/refresh_cache.py @@ -0,0 +1,10 @@ +from django.core.management.base import BaseCommand + +from purchase.models import Cache + + +class Command(BaseCommand): + help = "Refresh cache" # noqa: A003 + + def handle(self, *args, **options): # noqa: ARG002 + Cache.get_solo().refresh()