MCPcopy Create free account
hub / github.com/runhey/OnmyojiAutoScript / wait_until

Method wait_until

script.py:267–291  ·  view source on GitHub ↗

Wait until a specific time. Args: future (datetime): Returns: bool: True if wait finished, False if config changed.

(self, future)

Source from the content-addressed store, hash-verified

265
266
267 def wait_until(self, future):
268 """
269 Wait until a specific time.
270
271 Args:
272 future (datetime):
273
274 Returns:
275 bool: True if wait finished, False if config changed.
276 """
277 future = future + timedelta(seconds=1)
278 self.config.start_watching()
279 while 1:
280 if datetime.now() > future:
281 return True
282 # if self.stop_event is not None:
283 # if self.stop_event.is_set():
284 # logger.info("Update event detected")
285 # logger.info(f"[{self.config_name}] exited. Reason: Update")
286 # exit(0)
287
288 time.sleep(5)
289
290 if self.config.should_reload():
291 return False
292
293 def get_next_task(self) -> str:
294 """

Callers 1

get_next_taskMethod · 0.95

Calls 3

start_watchingMethod · 0.80
sleepMethod · 0.80
should_reloadMethod · 0.80

Tested by

no test coverage detected