mirror of
https://opendev.org/x/pyghmi
synced 2025-01-27 19:37:44 +00:00
Merge "Provide a grace period for session validity"
This commit is contained in:
commit
571d70edc7
@ -406,7 +406,7 @@ class Session(object):
|
||||
with util.protect(KEEPALIVE_SESSIONS):
|
||||
sess = cls.keepalive_sessions.get(session, None)
|
||||
if sess is not None and 'timeout' in sess:
|
||||
if sess['timeout'] < _monotonic_time():
|
||||
if sess['timeout'] < _monotonic_time() - 15:
|
||||
# session would have timed out by now, don't use it
|
||||
return False
|
||||
return True
|
||||
|
Loading…
x
Reference in New Issue
Block a user