From d9d63e1660ef28c91c2cdd44a226a881283c0ed5 Mon Sep 17 00:00:00 2001 From: James Turk Date: Thu, 4 Aug 2011 15:29:59 -0400 Subject: [PATCH] no need for max arg on get_update_queue anymore --- oyster/client.py | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/oyster/client.py b/oyster/client.py index 7448d66..96d4c43 100644 --- a/oyster/client.py +++ b/oyster/client.py @@ -138,24 +138,17 @@ class Client(object): return self.fs.get_version(url, n) - def get_update_queue(self, max=0): + def get_update_queue(self): # results are always sorted by random to avoid piling on single server # first we try to update anything that we've never retrieved new = self.db.tracked.find({'next_update': {'$exists': False}}).sort('_random') - if max: - new = new.limit(max) - queue = list(new) # pull the rest from those for which next_update is in the past next = self.db.tracked.find({'next_update': {'$lt': datetime.datetime.utcnow()}}).sort('_random') - if max: - max -= len(queue) - next = next.limit(max) - queue.extend(next) return queue