-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Background
The cached_result() decorator can generate dynamic keys for caching data in Redis.
Applying that decorator to a function which takes complex types/objects would generate cache keys containing memory addresses, effectively negating the effect of the caching (and filling up Redis as a bonus).
This has been partially addressed in #46 by
- Stripping the
selfargument from the cache key, in case the decorator is applied to an instance method - Checking the decorated function's signature for unsafe types and warning the user
In the long term we may want to improve this, if there's a usecase for it. So please leave a comment with your findings.
Feature improvements
- Add
types.pyfrom orchestrator-core (and add tests etc) to nwa-stdlib to improve unsafe types detection/warning - Change
cached_result()to accept a callable for users to override dynamic key generation
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request