def _maybe_quit(cls, started_at, max_overall_runtime): now = datetime.datetime.now() elapsed_runtime = now - started_at if max_overall_runtime < elapsed_runtime: raise MaxRuntimeExceeded( 'Max runtime for performance data cycling exceeded')
def assert_can_run(self): if self.runtime_exceeded(): raise MaxRuntimeExceeded("Sherlock: Max runtime exceeded.")
def assert_can_run(self): if self.runtime_exceeded(): raise MaxRuntimeExceeded( f'Max runtime for {self.__class__.__name__} exceeded')
def _quit_on_timeout(self): elapsed_runtime = datetime.now() - self.started_at if self.max_runtime < elapsed_runtime: raise MaxRuntimeExceeded( 'Max runtime for performance data cycling exceeded')