mirror of
https://opendev.org/x/pyghmi
synced 2025-08-09 12:50:16 +00:00
Reduce instances of duplicate login
While XCC is aggressive about expiring tokens, sometimes it isn't. In such a case, throw a logout request to the 'stale' session in case it isn't to avoid consuming too many session slots. Change-Id: I01819786755d5d5d29014c58d4dcbe5468c63607
This commit is contained in:
@@ -372,6 +372,10 @@ class IMMClient(object):
|
||||
def wc(self):
|
||||
if (not self._wc or (self._wc.vintage and
|
||||
self._wc.vintage < util._monotonic_time() - 30)):
|
||||
if not self.updating and self._wc:
|
||||
# in case the existing session is still valid
|
||||
# dispose of the session
|
||||
self.weblogout()
|
||||
self._wc = self.get_webclient()
|
||||
return self._wc
|
||||
|
||||
|
Reference in New Issue
Block a user