diff --git a/distributed/scheduler.py b/distributed/scheduler.py index d73da7c71f..8e698c4d4c 100644 --- a/distributed/scheduler.py +++ b/distributed/scheduler.py @@ -4329,12 +4329,8 @@ async def close( timeout: float | None = None, reason: str = "unknown", ) -> None: - """Send cleanup signal to all coroutines then wait until finished - - See Also - -------- - Scheduler.cleanup - """ + """Send cleanup signal to all coroutines then wait until finished""" + if self.status in (Status.closing, Status.closed): await self.finished() return