perf: open svc account register on deploy

This commit is contained in:
ibuler
2025-06-09 11:50:22 +08:00
committed by 老广
parent 48a9b2664a
commit 1e07cba545
2 changed files with 6 additions and 1 deletions

View File

@@ -3,6 +3,7 @@
import time
from django.conf import settings
from django.core.cache import cache
from rest_framework import permissions
@@ -30,6 +31,8 @@ class WithBootstrapToken(permissions.BasePermission):
def check_can_register(self):
enabled = settings.SECURITY_SERVICE_ACCOUNT_REGISTRATION
if enabled == 'auto':
if cache.get(f'APPLET_HOST_DELOYING'):
return True
return time.time() - settings.JUMPSERVER_UPTIME < 300
elif enabled:
return True