Reduce API startup storage prewarm
This commit is contained in:
@@ -585,7 +585,7 @@ def _load_persisted_state() -> None:
|
||||
_rbac.users[access.user_id] = access
|
||||
for payload in _storage.list_documents("privacy_markers"):
|
||||
_privacy.upsert_marker(PrivacyMarker.model_validate(payload))
|
||||
version_load_limit = int(os.environ.get("SFERA_STARTUP_OBJECT_VERSION_LIMIT", "5000"))
|
||||
version_load_limit = int(os.environ.get("SFERA_STARTUP_OBJECT_VERSION_LIMIT", "0"))
|
||||
for payload in _storage.list_documents("object_versions", limit=version_load_limit):
|
||||
_versions.upsert_version(SemanticObjectVersion.model_validate(payload))
|
||||
|
||||
@@ -2338,10 +2338,10 @@ async def download_windows_agent_cmd_installer(request: Request, agent_id: str |
|
||||
if agent_id:
|
||||
installer_url = f"{installer_url}?agent_id={quote(agent_id, safe='')}"
|
||||
escaped_installer_url = installer_url.replace("%", "%%")
|
||||
script = f"""@echo off
|
||||
script = fr"""@echo off
|
||||
setlocal
|
||||
set "INSTALLER_URL={escaped_installer_url}"
|
||||
set "INSTALLER=%TEMP%\\install-sfera-windows-agent.ps1"
|
||||
set "INSTALLER=%TEMP%\install-sfera-windows-agent.ps1"
|
||||
echo Downloading SFERA Windows Agent installer...
|
||||
powershell.exe -NoProfile -ExecutionPolicy Bypass -Command "Invoke-WebRequest -UseBasicParsing -Uri $env:INSTALLER_URL -OutFile $env:INSTALLER"
|
||||
if errorlevel 1 (
|
||||
|
||||
Reference in New Issue
Block a user