def recheck_limits(self):
        """
        Re-check that the cached limits are the current limits.
        """

        limit_data = self.control_daemon.get_limits()

        try:
            # Get the new checksum and list of limits
            new_sum, new_limits = limit_data.get_limits(self.limit_sum)

            # Convert the limits list into a list of objects
            lims = database.limits_hydrate(self.db, new_limits)

            # Save the new data
            self.limits = lims
            self.limit_map = dict((lim.uuid, lim) for lim in lims)
            self.limit_sum = new_sum
        except control.NoChangeException:
            # No changes to process; just keep going...
            return
        except Exception:
            # Log an error
            LOG.exception("Could not load limits")

            # Get our error set and publish channel
            control_args = self.conf['control']
            error_key = control_args.get('errors_key', 'errors')
            error_channel = control_args.get('errors_channel', 'errors')

            # Get an informative message
            msg = "Failed to load limits: " + traceback.format_exc()

            # Store the message into the error set.  We use a set
            # here because it's likely that more than one node
            # will generate the same message if there is an error,
            # and this avoids an explosion in the size of the set.
            with utils.ignore_except():
                self.db.sadd(error_key, msg)

            # Publish the message to a channel
            with utils.ignore_except():
                self.db.publish(error_channel, msg)
def recheck_limits ( self ) : limit_data = self . control_daemon . get_limits ( ) try : new_sum , new_limits = limit_data . get_limits ( self . limit_sum ) lims = database . limits_hydrate ( self . db , new_limits ) self . limits = lims self . limit_map = dict ( ( lim . uuid , lim ) for lim in lims ) self . limit_sum = new_sum except control . NoChangeException : return except Exception : LOG . exception ( "Could not load limits" ) control_args = self . conf [ 'control' ] error_key = control_args . get ( 'errors_key' , 'errors' ) error_channel = control_args . get ( 'errors_channel' , 'errors' ) msg = "Failed to load limits: " + traceback . format_exc ( ) with utils . ignore_except ( ) : self . db . sadd ( error_key , msg ) with utils . ignore_except ( ) : self . db . publish ( error_channel , msg )
Re-check that the cached limits are the current limits.