Reduce caching to 5min to speed up UI refreshes in case of open orders.

This commit is contained in:
Matthias
2024-01-04 14:22:02 +01:00
parent b9786b979a
commit 22307913d8
2 changed files with 8 additions and 7 deletions

View File

@@ -2528,13 +2528,13 @@ def test_get_entry_rate(mocker, default_conf, caplog, side, ask, bid,
assert exchange.get_rate('ETH/BTC', side="entry", is_short=False, refresh=True) == expected
assert not log_has(log_msg, caplog)
time_machine.move_to(start_dt + timedelta(minutes=29), tick=False)
time_machine.move_to(start_dt + timedelta(minutes=4), tick=False)
# Running a 2nd time without Refresh!
caplog.clear()
assert exchange.get_rate('ETH/BTC', side="entry", is_short=False, refresh=False) == expected
assert log_has(log_msg, caplog)
time_machine.move_to(start_dt + timedelta(minutes=31), tick=False)
time_machine.move_to(start_dt + timedelta(minutes=6), tick=False)
# Running a 2nd time - forces refresh due to ttl timeout
caplog.clear()
assert exchange.get_rate('ETH/BTC', side="entry", is_short=False, refresh=False) == expected
@@ -2571,13 +2571,13 @@ def test_get_exit_rate(default_conf, mocker, caplog, side, bid, ask,
assert exchange.get_rate(pair, side="exit", is_short=False, refresh=False) == expected
assert log_has(log_msg, caplog)
time_machine.move_to(start_dt + timedelta(minutes=29), tick=False)
time_machine.move_to(start_dt + timedelta(minutes=4), tick=False)
# Caching still active - TTL didn't expire
caplog.clear()
assert exchange.get_rate(pair, side="exit", is_short=False, refresh=False) == expected
assert log_has(log_msg, caplog)
time_machine.move_to(start_dt + timedelta(minutes=32), tick=False)
time_machine.move_to(start_dt + timedelta(minutes=6), tick=False)
# Caching expired - refresh forced
caplog.clear()
assert exchange.get_rate(pair, side="exit", is_short=False, refresh=False) == expected