Mutex TTL Cache accesses which can be accessed by multiple threads

Apparently, cachetools is (intentionally) not threadsafe
when using the Caches directly.
It's therefore recommended to wrap these with an explicit lock to avoid
problems.

source: https://github.com/tkem/cachetools/issues/245

closes #7215
This commit is contained in:
Matthias
2022-08-16 19:43:41 +02:00
parent ea6bc47d7a
commit 0b0e7eaf96
2 changed files with 17 additions and 8 deletions

View File

@@ -483,6 +483,7 @@ class Hyperopt:
self.backtesting.exchange._api_async = None
self.backtesting.exchange.loop = None # type: ignore
self.backtesting.exchange._loop_lock = None # type: ignore
self.backtesting.exchange._cache_lock = None # type: ignore
# self.backtesting.exchange = None # type: ignore
self.backtesting.pairlists = None # type: ignore