Wait until a specific time. Args: future (datetime): Returns: bool: True if wait finished, False if config changed.
(self, future)
| 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 | """ |
no test coverage detected