def _flush_if_needed(self,now):
        if self._current_ts is not None:
            g1 = self.get_group_ts(self._current_ts)
            g2 = self.get_group_ts(now)
            self.log.debug("Resources: (%s) group now: %s, group ts: %s" % (self.RESOURCE_KEY,g2,g1))
            if g1 != g2:  # It's time to flush
                self.log.debug("Resources: Flushing %s snapshots" % self.RESOURCE_KEY)
                self.flush_snapshots(g2)
                self._current_ts = None

    #--------------------------------- public API ------------------------------------------
Test the ability to edit a hook on a repository.
dataset/ETHPy150Open serverdensity/sd-agent/resources/__init__.py/ResourcePlugin._flush_if_needed--crossover with--dataset/ETHPy150Open sigmavirus24/github3.py/tests/integration/test_repos_repo.py/TestHook.test_edit