(self, curs, queue_name)
Force tick into source queue so that consumer can move on faster
Force tick into source queue so that consumer can move on faster
Force tick into source queue so that consumer can move on faster
def force_tick(self, curs, queue_name):
        """ Force tick into source queue so that consumer can move on faster
        """
        q = "select pgq.force_tick(%s)"
        curs.execute(q, [queue_name])
        res = curs.fetchone()
        cur_pos = res[0]

        start = time.time()
        while 1:
            time.sleep(0.5)
            curs.execute(q, [queue_name])
            res = curs.fetchone()
            if res[0] != cur_pos:
                # new pos
                return res[0]

            # dont loop more than 10 secs
            dur = time.time() - start
            if dur > 10 and not self.options.force:
                raise Exception("Ticker seems dead")
def force_tick ( self , curs , queue_name ) : q = "select pgq.force_tick(%s)" curs . execute ( q , [ queue_name ] ) res = curs . fetchone ( ) cur_pos = res [ 0 ] start = time . time ( ) while 1 : time . sleep ( 0.5 ) curs . execute ( q , [ queue_name ] ) res = curs . fetchone ( ) if res [ 0 ] != cur_pos : # new pos return res [ 0 ] # dont loop more than 10 secs dur = time . time ( ) - start if dur > 10 and not self . options . force : raise Exception ( "Ticker seems dead" )