Also invalidate single relations: when an instance is invalidated, we also look for any relations that the instance "belongs to" and we invalidate their cache as well.
For example, given somethinf like:
class Order(...):
user_id = ...
user = relation(...)
Previously when saving a new order like this:
order = Order()
user.orders.append(order)
This would bust the user cache -- because sqlalchemy knew that the user
had been edited and would include it in the session's dirty
map. However
if you saved an order like this:
order = Order(user_id=1234)
Sqlalchemy didn't pick up on the user relation. So, this release introduces an attempt to pick up on these changes manually.
(At the time of writing, it's been tested successfully in a proprietary app but the tests haven't been ported here).
Refactor the redis integration out to pyramid_redis
and lose the trace
module.
- wrap calls to redis with a resilient function that retries on a connection error and fails silently when its safe to do so
- rebuild sdist without logging
- provide a reified
request.redis
client, instead of callingrequest.redis()
to get a redis client.
- add optional
alkey.trace.trace_redis
function to integrate the redis client with new relic monitoring.
- fix major bug causing cache keys that should be different to match by adding
the
object_id
to the cache key argument, as well as the token value: this means that keys generated with an instance argument will always be unique to that instance (instead of previously matching an instance edited in the same commit)
- bug fix model class write tokens
- provide (optional)
request.cache_manager
- maintain table write tokens, e.g.:
alkey:users#*
.
- namespace the global write token to
alkey:*#*
.
- only invalidate tokens in response to instance changes recorded within a transaction that is committed successfully
- introduce the
'*#*'
global write token
Initial version.