The issue that caused DIMAGI-BOTS-HA is that functools.cache creates a global cache which resulted in the same 'trace service' being used in successive calls. This PR adds a new commit which changes the cached function to a cached property which is local to the class instance.
Description
Redo of https://github.com/dimagi/open-chat-studio/pull/835
The issue that caused DIMAGI-BOTS-HA is that
functools.cache
creates a global cache which resulted in the same 'trace service' being used in successive calls. This PR adds a new commit which changes the cached function to a cached property which is local to the class instance.For more info on the topic see https://rednafi.com/python/lru_cache_on_methods/