def __call__(self):
        """
        Retrieve the next bucket key to compact.  If no buckets are
        available for compacting, sleeps for a given period of time
        and tries again.

        :returns: The bucket key to compact.
        """

        while True:
            now = time.time()

            # Drop all items older than max_age; they're no longer
            # quiesced, since the compactor logic will cause new
            # summarize records to be generated.  No lock is needed...
            self.db.zremrangebyscore(self.key, 0, now - self.max_age)

            # Get an item and return it
            item = self.get(now)
            if item:
                LOG.debug("Next bucket to compact: %s" % item)
                return item

            # If we didn't get one, idle
            LOG.debug("No buckets to compact; sleeping for %s seconds" %
                      self.idle_sleep)
            time.sleep(self.idle_sleep)
def __call__ ( self ) : while True : now = time . time ( ) self . db . zremrangebyscore ( self . key , 0 , now - self . max_age ) item = self . get ( now ) if item : LOG . debug ( "Next bucket to compact: %s" % item ) return item LOG . debug ( "No buckets to compact; sleeping for %s seconds" % self . idle_sleep ) time . sleep ( self . idle_sleep )
Retrieve the next bucket key to compact.  If no buckets are
        available for compacting, sleeps for a given period of time
        and tries again.

        :returns: The bucket key to compact.