Changeset 51465 in webkit


Ignore:
Timestamp:
Nov 28, 2009 5:53:38 PM (14 years ago)
Author:
abarth@webkit.org
Message:

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:
Location:
trunk/WebKitTools
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKitTools/ChangeLog

    r51464 r51465  
     12009-11-28  Adam Barth  <abarth@webkit.org>
     2
     3        Reviewed by Eric Seidel.
     4
     5        [bzt] style-queue sends ~100 requests to QueueStatusServer every 5 minutes
     6        https://bugs.webkit.org/show_bug.cgi?id=31950
     7
     8        Now we cache the last status that we get back from QueueStatusServer.
     9        Eventually we'll have to do something more fancy if we want to support
     10        a "try again" button on QueueStatusServer, but we can cross that bridge
     11        when we come to it.
     12
     13        * Scripts/modules/patchcollection.py:
     14
    1152009-11-28  Adam Barth  <abarth@webkit.org>
    216
  • trunk/WebKitTools/Scripts/modules/patchcollection.py

    r51464 r51465  
    7878        self._name = self._delegate.collection_name()
    7979        self._status = self._delegate.status_server()
     80        self._status_cache = {}
     81
     82    def _cached_status(self, patch_id):
     83        cached = self._status_cache.get(patch_id)
     84        if cached:
     85            return cached
     86        status = self._status.patch_status(self._name, patch_id)
     87        if status:
     88            self._status_cache[patch_id] = status
     89        return status
    8090
    8191    def next(self):
    8292        patch_ids = self._delegate.fetch_potential_patch_ids()
    8393        for patch_id in patch_ids:
    84             last_status = self._status.patch_status(self._name, patch_id)
    85             if not last_status: # FIXME: Add support for "Try again"
     94            status = self._cached_status(patch_id)
     95            if not status:
    8696                return patch_id
    8797
Note: See TracChangeset for help on using the changeset viewer.