Skip to content

Commit

Permalink
Respawn a process only if returncode != 0
Browse files Browse the repository at this point in the history
  • Loading branch information
lukicdarkoo committed Jun 21, 2021
1 parent d0f7a68 commit e47e56a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion launch/launch/actions/execute_process.py
Original file line number Diff line number Diff line change
Expand Up @@ -766,7 +766,7 @@ async def __execute_process(self, context: LaunchContext) -> None:
))
await context.emit_event(ProcessExited(returncode=returncode, **process_event_args))
# respawn the process if necessary
if not context.is_shutdown and not self.__shutdown_future.done() and self.__respawn:
if not context.is_shutdown and not self.__shutdown_future.done() and self.__respawn and returncode != 0:
if self.__respawn_delay is not None and self.__respawn_delay > 0.0:
# wait for a timeout(`self.__respawn_delay`) to respawn the process
# and handle shutdown event with future(`self.__shutdown_future`)
Expand Down

0 comments on commit e47e56a

Please sign in to comment.