-
Bug
-
Resolution: Fixed
-
Normal
-
None
-
None
1. When creating a cache item with an expiry time, the key is hashed twice, which means that we never set the expiry of the key: https://github.com/metabrainz/brainzutils-python/blob/8420319c488bf3fba53483f7e4f0c062e0581fb0/brainzutils/cache.py#L167-L168
2. Documentation for set says that the expire time can be provided in seconds, or an epoch time, or 0. Documentation for set_many (which is called by set) says that expire time must be in milliseconds:
https://github.com/metabrainz/brainzutils-python/blob/8420319c488bf3fba53483f7e4f0c062e0581fb0/brainzutils/cache.py#L167-L168
https://github.com/metabrainz/brainzutils-python/blob/8420319c488bf3fba53483f7e4f0c062e0581fb0/brainzutils/cache.py#L157
I've checked AB, LB, CB, MeB, and all calls to cache.set that have a time expect this to be set with seconds, so I propose standardising the API to use seconds, and remove the absolute time. It looks like this was a holdback from Memcache (from the memcache docs: "Any time higher than 30 days is interpreted as a unix timestamp date.")
- is a dependency of
-
AB-335 Webpage of http://acousticbrainz.org/ is not refreshing the example
- Closed