Skip to content

Commit

Permalink
Merge pull request #876 from palango/close-evicted-sessions
Browse files Browse the repository at this point in the history
Close evicted sessions
  • Loading branch information
dylanjw authored May 31, 2018
2 parents 16cac3c + e5fe731 commit 6c11cb4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion web3/utils/request.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@
generate_cache_key,
)

_session_cache = lru.LRU(8)

def _remove_session(key, session):
session.close()


_session_cache = lru.LRU(8, callback=_remove_session)


def _get_session(*args, **kwargs):
Expand Down

0 comments on commit 6c11cb4

Please sign in to comment.