Skip to content

Commit 387e419

Browse files
committed
[Keywords] increase tentacles cache size
1 parent b7e2838 commit 387e419

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Meta/Keywords/scripting_library/configuration/tentacles_configuration.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,21 +22,23 @@
2222

2323
import octobot_tentacles_manager.api
2424

25+
_EXPECTED_MAX_TENTACLES_COUNT = 256
26+
2527

2628
def get_config_history_propagated_tentacles_config_keys(tentacle: str) -> list[str]:
2729
tentacle_class = octobot_tentacles_manager.api.get_tentacle_class_from_string(tentacle)
2830
return tentacle_class.get_config_history_propagated_tentacles_config_keys()
2931

3032

3133
# cached to avoid calling default_parents_inspection when unnecessary
32-
@functools.lru_cache(maxsize=128)
34+
@functools.lru_cache(maxsize=_EXPECTED_MAX_TENTACLES_COUNT)
3335
def is_trading_mode_tentacle(tentacle_name: str) -> bool:
3436
tentacle_class = octobot_tentacles_manager.api.get_tentacle_class_from_string(tentacle_name)
3537
return tentacles_management.default_parents_inspection(tentacle_class, octobot_trading.modes.AbstractTradingMode)
3638

3739

3840
# cached to avoid calling default_parents_inspection when unnecessary
39-
@functools.lru_cache(maxsize=128)
41+
@functools.lru_cache(maxsize=_EXPECTED_MAX_TENTACLES_COUNT)
4042
def is_exchange_tentacle(tentacle_name: str) -> bool:
4143
tentacle_class = octobot_tentacles_manager.api.get_tentacle_class_from_string(tentacle_name)
4244
return tentacles_management.default_parents_inspection(tentacle_class, exchanges.RestExchange)

0 commit comments

Comments
 (0)