DEBUG: lock holder for LockExpiredError
This commit is contained in:
parent
fea0ceb08e
commit
9fba4fb72a
@ -3451,12 +3451,11 @@ class StateManagerRedis(StateManager):
|
|||||||
RuntimeError: If the state instance doesn't match the state name in the token.
|
RuntimeError: If the state instance doesn't match the state name in the token.
|
||||||
"""
|
"""
|
||||||
# Check that we're holding the lock.
|
# Check that we're holding the lock.
|
||||||
if (
|
lock_holder = await self.redis.get(self._lock_key(token))
|
||||||
lock_id is not None
|
if lock_id is not None and lock_holder != lock_id:
|
||||||
and await self.redis.get(self._lock_key(token)) != lock_id
|
|
||||||
):
|
|
||||||
raise LockExpiredError(
|
raise LockExpiredError(
|
||||||
f"Lock expired for token {token} while processing. Consider increasing "
|
f"Lock expired for token {token} while processing. My lock id {lock_id} != {lock_holder}. "
|
||||||
|
"Consider increasing "
|
||||||
f"`app.state_manager.lock_expiration` (currently {self.lock_expiration}) "
|
f"`app.state_manager.lock_expiration` (currently {self.lock_expiration}) "
|
||||||
"or use `@rx.event(background=True)` decorator for long-running tasks."
|
"or use `@rx.event(background=True)` decorator for long-running tasks."
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user