return state in ("pending", "running")
- async def is_shutdown(self):
+ async def is_shut_down(self):
"""
Returns True if this builder is shut down
"""
"""
Starts the instance on AWS
"""
+ # Do nothing if the builder is already running
+ if await self.is_running():
+ return
+
await asyncio.to_thread(self._start, wait=wait)
def _start(self, wait):
"""
Stops this instance on AWS
"""
+ # Do nothing if the builder is already shut down
+ if await self.is_shutting_down() or await self.is_shut_down():
+ return
+
await asyncio.to_thread(self._stop, wait=wait)
def _stop(self, wait):