+2009-11-28 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ [bzt] style-queue sends ~100 requests to QueueStatusServer every 5 minutes
+ https://bugs.webkit.org/show_bug.cgi?id=31950
+
+ Now we cache the last status that we get back from QueueStatusServer.
+ Eventually we'll have to do something more fancy if we want to support
+ a "try again" button on QueueStatusServer, but we can cross that bridge
+ when we come to it.
+
+ * Scripts/modules/patchcollection.py:
+
2009-11-28 Adam Barth <abarth@webkit.org>
Reviewed by Eric Seidel.
self._delegate = delegate
self._name = self._delegate.collection_name()
self._status = self._delegate.status_server()
+ self._status_cache = {}
+
+ def _cached_status(self, patch_id):
+ cached = self._status_cache.get(patch_id)
+ if cached:
+ return cached
+ status = self._status.patch_status(self._name, patch_id)
+ if status:
+ self._status_cache[patch_id] = status
+ return status
def next(self):
patch_ids = self._delegate.fetch_potential_patch_ids()
for patch_id in patch_ids:
- last_status = self._status.patch_status(self._name, patch_id)
- if not last_status: # FIXME: Add support for "Try again"
+ status = self._cached_status(patch_id)
+ if not status:
return patch_id
def done(self, patch):