INNER CODE UNIT · Python

_cancel_config_reload_task

yihong1120/Construction-Hazard-Detection · main.py:165

    async def _cancel_config_reload_task(self) -> None:
        """Cancel an in-flight callback reload before process shutdown."""
        task = self._config_reload_task
        self._config_reload_task = None
        if task is None or task.done() or task is asyncio.current_task():
            return
        task.cancel()
        with suppress(asyncio.CancelledError):
            await task

    async def _close_config_listener(self, pool: Pool | None = None) -> None:
        """Release the reserved LISTEN connection before closing its pool."""
        connection = self._config_listener_connection
        self._config_listener_connection = None
        if connection is None:
            return

        target_pool = pool or self.db_pool

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…