mirror of
https://github.com/viq/NewsBlur.git
synced 2025-04-13 09:38:09 +00:00
Fixing persistance of redis keys due to redis' RESTORE command using a millisecond TTL, not a second TTL.
This commit is contained in:
parent
c2dcbe27f8
commit
2b08d13f6d
2 changed files with 9 additions and 3 deletions
|
@ -199,7 +199,7 @@ class UserSubscription(models.Model):
|
|||
if dump:
|
||||
pipeline = rt.pipeline()
|
||||
pipeline.delete(unread_ranked_stories_key)
|
||||
pipeline.restore(unread_ranked_stories_key, 1*60*60, dump)
|
||||
pipeline.restore(unread_ranked_stories_key, 1*60*60*1000, dump)
|
||||
pipeline.execute()
|
||||
r.delete(unread_ranked_stories_key)
|
||||
|
||||
|
|
|
@ -45,5 +45,11 @@ class RedisDumpMiddleware(object):
|
|||
return instrumented_method
|
||||
|
||||
def process_message(self, *args, **kwargs):
|
||||
query = ' '.join([str(arg) for arg in args if not isinstance(arg, Connection)])
|
||||
return { 'query': query, }
|
||||
query = []
|
||||
for a, arg in enumerate(args):
|
||||
if isinstance(arg, Connection):
|
||||
continue
|
||||
if args[1] == "RESTORE" and a == 4:
|
||||
arg = "[%s bytes]" % len(arg)
|
||||
query.append(str(arg).replace('\n', ''))
|
||||
return { 'query': ' '.join(query) }
|
Loading…
Add table
Reference in a new issue