chore: clear workspace license on restart (#939)

This commit is contained in:
Nikhil
2024-08-26 20:44:38 +05:30
committed by GitHub
parent bebf00e601
commit 640ae4bba0
2 changed files with 20 additions and 0 deletions

View File

@@ -33,4 +33,7 @@ python manage.py create_bucket
# Clear Cache before starting to remove stale values
python manage.py clear_cache
# Clear workspace licenses
python manage.py clear_workspace_licenses
exec gunicorn -w "$GUNICORN_WORKERS" -k uvicorn.workers.UvicornWorker plane.asgi:application --bind 0.0.0.0:"${PORT:-8000}" --max-requests 1200 --max-requests-jitter 1000 --access-logfile -

View File

@@ -0,0 +1,17 @@
# Django imports
from django.core.management import BaseCommand
# Module imports
from plane.ee.models import WorkspaceLicense
class Command(BaseCommand):
help = "Clear the workspace licenses on the start up"
def handle(self, *args, **options):
# Clear the workspace licenses
WorkspaceLicense.objects.all().delete()
self.stdout.write(
self.style.SUCCESS("Workspace licenses cleared successfully")
)
return