Skip to content

Commit

Permalink
Update BaseOperation.py
Browse files Browse the repository at this point in the history
  • Loading branch information
lane-neuro committed Jun 22, 2024
1 parent 39a413b commit eb44aab
Showing 1 changed file with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,16 @@ async def stop(self, child_operations=False):
"""
await stop_operation(self, child_operations)

async def restart(self, child_operations=False):
"""
Restart the operation and all child operations, if applicable.
"""
self.is_ready = False
await self.reset(child_operations)

self.is_ready = True
await self.execute()

async def reset(self, child_operations=False):
"""
Reset the operation and all child operations, if applicable.
Expand Down Expand Up @@ -593,16 +603,6 @@ def is_ready(self, value):
if not child.is_complete and not child.concurrent:
self._is_ready = False

async def restart(self, child_operations=False):
"""
Restart the operation and all child operations, if applicable.
"""
self.is_ready = False
await self.reset(child_operations)

self.is_ready = True
await self.execute()

@property
def is_running(self) -> bool:
"""
Expand Down

0 comments on commit eb44aab

Please sign in to comment.