Add locks per pair

This commit is contained in:
Matthias
2020-10-24 16:52:26 +02:00
parent ff7ba23477
commit 2a66c33a4e
6 changed files with 101 additions and 2 deletions

View File

@@ -57,3 +57,12 @@ class ProtectionManager():
PairLocks.lock_pair('*', until, reason)
return True
return False
def stop_per_pair(self, pair) -> bool:
now = datetime.now(timezone.utc)
for protection_handler in self._protection_handlers:
result, until, reason = protection_handler.stop_per_pair(pair, now)
if result and until:
PairLocks.lock_pair(pair, until, reason)
return True
return False