mirror of
https://github.com/Akkudoktor-EOS/EOS.git
synced 2026-10-11 16:51:56 +00:00
fix(cache): distinguish callables in the shared EMS cache
Include the function object in cache keys so methods of one interpolator cannot reuse a probability as a power value. Cover both call orders, keyword arguments, cache hits and separate closures with identical qualified names.
This commit is contained in:
@@ -228,6 +228,9 @@ def cache_energy_management(
|
||||
|
||||
cached_wrapper = cachebox.cached(
|
||||
cache=CacheEnergyManagementStore().cache,
|
||||
# This store is shared by all decorated callables, including methods
|
||||
# on the same instance. Arguments alone cannot identify their results.
|
||||
key_maker=lambda *args, **kwargs: cachebox.make_key(func, *args, **kwargs),
|
||||
callback=cache_energy_management_store_callback,
|
||||
)(wrapper)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user