django-cacheback
django-cacheback copied to clipboard
`cache_alias` option is not respected in FunctionJob and cacheback decorator
trafficstars
Just that, if you pass the cache_alias option to a FunctionJob (and hence the cacheback decorator), the resulting function won't respect it. The reason why is because FunctionJob's super __init__ is called before self.cache_alias is set:
https://github.com/codeinthehole/django-cacheback/blob/890772b5c37fba08e301eecbfeedc1180297ba14/cacheback/jobs.py#L16-L22
But of course, FunctionJob's super __init__ depends on self.cache_alias, so it's too late to influence the initialization of the cache.
I'm actually responsible for this bug, so I'll also submit a PR. 🙂
My PR fix that too.
https://github.com/codeinthehole/django-cacheback/pull/101