Permalink
Browse files

follow up to removal of last_known_push, and make poller reget last r…

…epo if max amount of pushes was gotten to catch up on large repos quicker
  • Loading branch information...
1 parent 4adde9d commit 132fc8565b1d12971eb2ecefe4b08f4d417ce8ff Axel Hecht committed Apr 1, 2009
Showing with 7 additions and 1 deletion.
  1. +7 −1 twisted/plugins/pushes_plugin.py
@@ -14,6 +14,7 @@
class Options(usage.Options):
optParameters = [["settings", "s", None, "Django settings module."],
["time", "t", "1", "Poll every n seconds."],
+ ["limit", "l", "200", "Limit pushes to n at a time."]
]
optFlags = [
["noup", "n", "No updates of repos"],
@@ -65,12 +66,17 @@ def poll(self):
jsonurl = getURL(repo, self.limit)
d = getPage(str(jsonurl), timeout = self.timeout)
d.addCallback(handlePushes, repo, self.do_update)
+ d.addCallback(self.maybeRePoll, repo)
d.addErrback(self.jsonErr, repo)
def decreaseRunning(ignored):
self.runnings -= 1
d.addBoth(decreaseRunning)
self.runnings += 1
-
+
+ def maybeRePoll(self, cnt, repo):
+ if cnt == self.limit:
+ # we got the limit amount of pushes, repoll the same repo
+ self.repos.append(repo)
def gotForest(self, page, forest):
self.runnings -= 1

0 comments on commit 132fc85

Please sign in to comment.