Skip to content

armgit / plane

Public Imported from GitHub
0

πŸ”₯πŸ”₯πŸ”₯ Open-source Jira, Linear, Monday, and ClickUp alternative. Plane is a modern project management platform to manage tasks, sprints, docs, and triage.

chore: update cache command to delete the cache entry for the cache key (#5309)

Nikhil2fa92fda752b
diff --git a/apiserver/plane/db/management/commands/clear_cache.py b/apiserver/plane/db/management/commands/clear_cache.py
index 4dfbe6c103..c1908eee7a 100644
--- a/apiserver/plane/db/management/commands/clear_cache.py
+++ b/apiserver/plane/db/management/commands/clear_cache.py
@@ -6,8 +6,23 @@ from django.core.management import BaseCommand
class Command(BaseCommand):
help = "Clear Cache before starting the server to remove stale values"
+ def add_arguments(self, parser):
+ # Positional argument
+ parser.add_argument(
+ "--key", type=str, nargs="?", help="Key to clear cache"
+ )
+
def handle(self, *args, **options):
try:
+ if options["key"]:
+ cache.delete(options["key"])
+ self.stdout.write(
+ self.style.SUCCESS(
+ f"Cache Cleared for key: {options['key']}"
+ )
+ )
+ return
+
cache.clear()
self.stdout.write(self.style.SUCCESS("Cache Cleared"))
return