formatting

This commit is contained in:
John Lancaster
2024-10-21 02:47:38 +00:00
parent a67b2998b7
commit bc2224a919
2 changed files with 6 additions and 6 deletions

View File

@@ -11,8 +11,6 @@ from typing import Any, Callable
logger = logging.getLogger(__name__)
@dataclass
class AppDaemonRunContext:
_stack: ExitStack = field(default_factory=ExitStack)
@@ -28,7 +26,8 @@ class AppDaemonRunContext:
signals = (signal.SIGHUP, signal.SIGTERM, signal.SIGINT)
for s in signals:
self.loop.add_signal_handler(s, lambda s=s: self.loop.create_task(self.shutdown(s)))
self.loop.add_signal_handler(
s, lambda s=s: self.loop.create_task(self.shutdown(s)))
self.executor = self._stack.enter_context(self.thread_context())
logger.debug("Started thread pool")
@@ -60,7 +59,8 @@ class AppDaemonRunContext:
asyncio.wait_for(t, timeout=self.shutdown_grace_period)
for t in tasks
)
logger.debug(f'Allowing graceful shutdown from stop event for {self.shutdown_grace_period}s')
logger.debug(f'Allowing graceful shutdown from stop event for {
self.shutdown_grace_period}s')
await asyncio.gather(*graceful, return_exceptions=True)
for task in tasks: