Skip to content

Commit

Permalink
#209: Flush session ID before putting client back into pool
Browse files Browse the repository at this point in the history
  • Loading branch information
MRichards99 committed Apr 6, 2021
1 parent b0350c9 commit e0fff60
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions datagateway_api/common/icat/lru_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ def popitem(self):
key, client = super().popitem()
session_id, client_pool = key
log.debug(f"Item popped from LRU cache: {key}, {client}")
# TODO - Session ID should probably get flushed here?
# Put client back into pool
# Passes in default stats for now, though these aren't used in the API

# Flushing session ID so next time the client object is used, there's no issues
client.sessionId = None

# Put client back into pool - resource stats aren't used in the API, so defaults
# are passed in
client_pool._queue_resource(client, client_pool._get_default_stats())

0 comments on commit e0fff60

Please sign in to comment.