mirror of
https://github.com/samuelclay/NewsBlur.git
synced 2025-09-18 21:50:56 +00:00
Merge branch 'master' into ios7
* master: Better limit on redis logging. Fixing persistance of redis keys due to redis' RESTORE command using a millisecond TTL, not a second TTL. Fixing redis issues by pipelining.
This commit is contained in:
commit
6bd1eba14d
2 changed files with 12 additions and 4 deletions
|
@ -197,8 +197,10 @@ class UserSubscription(models.Model):
|
||||||
|
|
||||||
dump = r.dump(unread_ranked_stories_key)
|
dump = r.dump(unread_ranked_stories_key)
|
||||||
if dump:
|
if dump:
|
||||||
rt.delete(unread_ranked_stories_key)
|
pipeline = rt.pipeline()
|
||||||
rt.restore(unread_ranked_stories_key, 1*60*60, dump)
|
pipeline.delete(unread_ranked_stories_key)
|
||||||
|
pipeline.restore(unread_ranked_stories_key, 1*60*60*1000, dump)
|
||||||
|
pipeline.execute()
|
||||||
r.delete(unread_ranked_stories_key)
|
r.delete(unread_ranked_stories_key)
|
||||||
|
|
||||||
current_time = int(time.time() + 60*60*24)
|
current_time = int(time.time() + 60*60*24)
|
||||||
|
|
|
@ -45,5 +45,11 @@ class RedisDumpMiddleware(object):
|
||||||
return instrumented_method
|
return instrumented_method
|
||||||
|
|
||||||
def process_message(self, *args, **kwargs):
|
def process_message(self, *args, **kwargs):
|
||||||
query = ' '.join([str(arg) for arg in args if not isinstance(arg, Connection)])
|
query = []
|
||||||
return { 'query': query, }
|
for a, arg in enumerate(args):
|
||||||
|
if isinstance(arg, Connection):
|
||||||
|
continue
|
||||||
|
if len(str(arg)) > 100:
|
||||||
|
arg = "[%s bytes]" % len(arg)
|
||||||
|
query.append(str(arg).replace('\n', ''))
|
||||||
|
return { 'query': ' '.join(query) }
|
Loading…
Add table
Reference in a new issue