fix lease issue (#12828)

This commit is contained in:
Matthias Mair
2026-09-09 07:15:05 +10:00
committed by GitHub
parent 7cd74eecd4
commit 97f7c039c9
2 changed files with 8 additions and 1 deletions
+5
View File
@@ -4,6 +4,7 @@ Used to serialize an potentially long-running operation,
without holding a database transaction open for the duration.
"""
import os
import time
from datetime import datetime, timedelta
from typing import Optional
@@ -81,6 +82,10 @@ def acquire_lease_blocking(
"""
deadline = time.monotonic() + timeout
if os.environ.get('SETUP_INITIALIZING', '0') == '1':
logger.debug("Skipping lease acquisition for '%s' during initialization", key)
return True
while True:
if try_acquire_lease(key):
return True