Browse Source

Closes #14458: Remove the clearcache management command

Jeremy Stretch 2 years ago
parent
commit
2d1f882724
2 changed files with 0 additions and 25 deletions
  1. 0 20
      netbox/core/management/commands/clearcache.py
  2. 0 5
      upgrade.sh

+ 0 - 20
netbox/core/management/commands/clearcache.py

@@ -1,20 +0,0 @@
-from django.core.cache import cache
-from django.core.management.base import BaseCommand
-
-from core.models import ConfigRevision
-
-
-class Command(BaseCommand):
-    """Command to clear the entire cache."""
-    help = 'Clears the cache.'
-
-    def handle(self, *args, **kwargs):
-        # Fetch the current config revision from the cache
-        config_version = cache.get('config_version')
-        # Clear the cache
-        cache.clear()
-        self.stdout.write('Cache has been cleared.', ending="\n")
-        if config_version:
-            # Activate the current config revision
-            ConfigRevision.objects.get(id=config_version).activate()
-            self.stdout.write(f'Config revision ({config_version}) has been restored.', ending="\n")

+ 0 - 5
upgrade.sh

@@ -113,11 +113,6 @@ COMMAND="python3 netbox/manage.py clearsessions"
 echo "Removing expired user sessions ($COMMAND)..."
 eval $COMMAND || exit 1
 
-# Clear the cache
-COMMAND="python3 netbox/manage.py clearcache"
-echo "Clearing the cache ($COMMAND)..."
-eval $COMMAND || exit 1
-
 if [ -v WARN_MISSING_VENV ]; then
   echo "--------------------------------------------------------------------"
   echo "WARNING: No existing virtual environment was detected. A new one has"