Beispiel #1
0
    def checkReplicationStatus(self, continuous=True):
        """
        _checkReplicationStatus_

        Check if the workqueue replication is ok, if not
        then delete the documents so that new replications can be triggered
        when appropiate.
        It returns True if there is no error, and False otherwise.
        """

        if self.parentCouchUrl and self.queueUrl:
            # only checks for local queue
            couchMonitor = CouchMonitor(self.server)
            filter = 'WorkQueue/queueFilter'
            query_params = {
                'childUrl': self.queueUrl,
                'parentUrl': self.parentCouchUrl
            }
            self.logger.info("set replication from GQ to LQ")
            couchMonitor.recoverReplicationErrors(
                self.parentCouchUrl,
                "%s/%s" % (self.hostWithAuth, self.inbox.name),
                filter=filter,
                query_params=query_params,
                checkUpdateSeq=False,
                continuous=continuous)
            self.logger.info("set replication from LQ to GQ")
            couchMonitor.recoverReplicationErrors(self.inbox.name,
                                                  self.parentCouchUrlWithAuth,
                                                  filter=filter,
                                                  query_params=query_params,
                                                  checkUpdateSeq=False,
                                                  continuous=continuous)
            return True
        return False
Beispiel #2
0
    def checkReplicationStatus(self, continuous = True):
        """
        _checkReplicationStatus_

        Check if the workqueue replication is ok, if not
        then delete the documents so that new replications can be triggered
        when appropiate.
        It returns True if there is no error, and False otherwise.
        """
        
        if self.parentCouchUrl and self.queueUrl:
            # only checks for local queue
            couchMonitor = CouchMonitor(self.server)
            filter = 'WorkQueue/queueFilter'
            query_params = {'childUrl' : self.queueUrl, 'parentUrl' : self.parentCouchUrl}
            self.logger.info("set replication from GQ to LQ")
            couchMonitor.recoverReplicationErrors(self.parentCouchUrl, 
                                                  "%s/%s" % (self.hostWithAuth, self.inbox.name), 
                                                  filter = filter, query_params = query_params,
                                                  checkUpdateSeq = False,
                                                  continuous = continuous)
            self.logger.info("set replication from LQ to GQ")
            couchMonitor.recoverReplicationErrors(self.inbox.name, self.parentCouchUrlWithAuth,
                                                  filter = filter, query_params = query_params,
                                                  checkUpdateSeq = False,
                                                  continuous = continuous)
            return True
        return False