johnny-cache
johnny-cache copied to clipboard
TransactionManager._flush not working when using JOHNNY_CACHE_KEY in settings.DATABASES
Happens other places inside TransactionManager, anywhere this code is used:
c = self.local.mget('%s_%s_*' % (self.prefix, self._trunc_using(using)))
The problem is that the 'using' variable is the DB key, not the substituted JOHNNY_CACHE_KEY value. It is done correctly during the KeyGen.gen_table_key:
db = unicode(settings.DB_CACHE_KEYS[db]) ... return '%s_%s_table_%s' % (self.prefix, db, table)
which puts them into self.local correctly during the set. But since we are looking for keys to flush that are not there, the real ones never get flushed