(self, copy_thread, prev_tick, cur_tick, no_lag)
Remove attached snapshot if possible.

        If the event processing is in current moment, the snapshot
        is not needed beyond next batch.

        The logic is needed for mostly unchanging tables,
        where the .ok_batch_count check in .interesting()
        method can take a lot of time.
Remove attached snapshot if possible.
Remove attached snapshot if possible .
def gc_snapshot(self, copy_thread, prev_tick, cur_tick, no_lag):
        """Remove attached snapshot if possible.

        If the event processing is in current moment, the snapshot
        is not needed beyond next batch.

        The logic is needed for mostly unchanging tables,
        where the .ok_batch_count check in .interesting()
        method can take a lot of time.
        """

        # check if gc is needed
        if self.str_snapshot is None:
            return

        # check if allowed to modify
        if copy_thread:
            if self.state != TABLE_CATCHING_UP:
                return
        else:
            if self.state != TABLE_OK:
                return False

        # aquire last tick
        if not self.last_snapshot_tick:
            if no_lag:
                self.last_snapshot_tick = cur_tick
            return

        # reset snapshot if not needed anymore
        if self.last_snapshot_tick < prev_tick:
            self.change_snapshot(None)
def gc_snapshot ( self , copy_thread , prev_tick , cur_tick , no_lag ) : # check if gc is needed if self . str_snapshot is None : return # check if allowed to modify if copy_thread : if self . state != TABLE_CATCHING_UP : return else : if self . state != TABLE_OK : return False # aquire last tick if not self . last_snapshot_tick : if no_lag : self . last_snapshot_tick = cur_tick return # reset snapshot if not needed anymore if self . last_snapshot_tick < prev_tick : self . change_snapshot ( None )