Skip to content

Commit

Permalink
Respawn a process only if returncode != 0
Browse files Browse the repository at this point in the history
Signed-off-by: Darko Lukic <[email protected]>
  • Loading branch information
lukicdarkoo committed Jun 21, 2021
1 parent d0f7a68 commit 17ce532
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 17ce532

Please sign in to comment.