(self)
Helper function to keep track of last successful batch in external database.
Helper function to keep track of last successful batch in external database.
Helper function to keep track of last successful batch in external database .
def is_batch_done(self):
        """Helper function to keep track of last successful batch in external database.
        """

        local_tick = self.load_local_tick()

        cur_tick = self.batch_info['tick_id']
        prev_tick = self.batch_info['prev_tick_id']

        if local_tick < 0:
            # seems this consumer has not run yet?
            return False

        if prev_tick == local_tick:
            # on track
            return False

        if cur_tick == local_tick:
            # current batch is already applied, skip it
            return True

        # anything else means problems
        raise Exception('Lost position: batch %d..%d, dst has %d' % (
                        prev_tick, cur_tick, local_tick))
def is_batch_done ( self ) : local_tick = self . load_local_tick ( ) cur_tick = self . batch_info [ 'tick_id' ] prev_tick = self . batch_info [ 'prev_tick_id' ] if local_tick < 0 : # seems this consumer has not run yet? return False if prev_tick == local_tick : # on track return False if cur_tick == local_tick : # current batch is already applied, skip it return True # anything else means problems raise Exception ( 'Lost position: batch %d..%d, dst has %d' % ( prev_tick , cur_tick , local_tick ) )