diff --git a/apiserver/bin/docker-entrypoint-api-ee.sh b/apiserver/bin/docker-entrypoint-api-ee.sh index f3448ffc73..28e0cc4123 100755 --- a/apiserver/bin/docker-entrypoint-api-ee.sh +++ b/apiserver/bin/docker-entrypoint-api-ee.sh @@ -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 - diff --git a/apiserver/plane/ee/management/commands/clear_workspace_licenses.py b/apiserver/plane/ee/management/commands/clear_workspace_licenses.py new file mode 100644 index 0000000000..77727bf98f --- /dev/null +++ b/apiserver/plane/ee/management/commands/clear_workspace_licenses.py @@ -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