Exemple #1
0
    async def serviceQueues(self, limit=None) -> int:
        """
        Service at most `limit` messages from the inBox.

        :param limit: the maximum number of messages to service
        :return: the number of messages successfully processed
        """
        # do not start any view changes until catch-up is finished!
        if not Mode.is_done_syncing(self.provider.node_mode()):
            return 0
        return await self.inBoxRouter.handleAll(self.inBox, limit)
Exemple #2
0
 def is_state_fresh_enough(self):
     threshold = self.config.ACCEPTABLE_FRESHNESS_INTERVALS_COUNT * self.config.STATE_FRESHNESS_UPDATE_INTERVAL
     return self.provider.state_freshness() < threshold or (not self.view_change_in_progress and
                                                            not Mode.is_done_syncing(self.provider.node_mode()))
Exemple #3
0
 def is_synced(self) -> bool:
     return Mode.is_done_syncing(self.mode)
Exemple #4
0
 def is_synced(self):
     return Mode.is_done_syncing(self.node_mode)