(self, deps_only=False)
| 688 | self._tasks.append(watchdog_task) |
| 689 | |
| 690 | async def _setup(self, deps_only=False): |
| 691 | """ """ |
| 692 | status_codes = {False: "hard-fail", None: "soft-fail", True: "success"} |
| 693 | |
| 694 | status = False |
| 695 | self.debug(f"Setting up module {self.name}") |
| 696 | try: |
| 697 | funcs = [self.setup_deps] |
| 698 | if not deps_only: |
| 699 | funcs.append(self.setup) |
| 700 | for func in funcs: |
| 701 | self.debug(f"Running {self.name}.{func.__name__}()") |
| 702 | result = await func() |
| 703 | if type(result) == tuple and len(result) == 2: |
| 704 | status, msg = result |
| 705 | else: |
| 706 | status = result |
| 707 | msg = status_codes[status] |
| 708 | if status is False: |
| 709 | break |
| 710 | self.debug(f"Finished setting up module {self.name}") |
| 711 | except Exception as e: |
| 712 | self.set_error_state(f"Unexpected error during module setup: {e}", critical=True) |
| 713 | msg = f"{e}" |
| 714 | self.trace() |
| 715 | return self, status, str(msg) |
| 716 | |
| 717 | async def _worker(self): |
| 718 | """ |
no test coverage detected