use get_all_locks to get locks for backtest result

This commit is contained in:
Matthias
2021-02-07 10:49:47 +01:00
parent e32b2097f0
commit 081b9be45c
2 changed files with 9 additions and 1 deletions

View File

@@ -123,3 +123,11 @@ class PairLocks():
now = datetime.now(timezone.utc)
return len(PairLocks.get_pair_locks(pair, now)) > 0 or PairLocks.is_global_lock(now)
@staticmethod
def get_all_locks() -> List[PairLock]:
if PairLocks.use_db:
return PairLock.query.all()
else:
return PairLocks.locks