def METHOD_NAME(self):
    """Main service entrypoint."""
    # N.B. We compute the invalidating fileset eagerly at launch with an assumption that files
    # that exist at startup are the only ones that can affect the running daemon.
    globs, _ = self._invalidation_globs_and_snapshot
    self._invalidation_globs_and_snapshot = (globs, self._get_snapshot(globs, poll=False))
    self._logger.debug(f"watching invalidation patterns: {globs}")
    pidfile_deadline = time.time() + self.PIDFILE_GRACE_PERIOD
    while not self._state.is_terminating:
        try:
            self._state.maybe_pause()
            self._check_invalidation_watcher_liveness()
            self._check_memory_usage()
            if time.time() > pidfile_deadline:
                self._check_pidfile()
            # NB: This is a long poll that will keep us from looping too quickly here.
            self._check_invalidation_globs(poll=True)
        except Exception as e:
            # Watcher failed for some reason
            self._logger.critical(f"The scheduler was invalidated: {e!r}")
            self.terminate()
    self._scheduler_session.cancel()