Skip to content

Commit 17ce532

Browse files
committed
Respawn a process only if returncode != 0
Signed-off-by: Darko Lukic <[email protected]>
1 parent d0f7a68 commit 17ce532

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

launch/launch/actions/execute_process.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -766,7 +766,7 @@ async def __execute_process(self, context: LaunchContext) -> None:
766766
))
767767
await context.emit_event(ProcessExited(returncode=returncode, **process_event_args))
768768
# respawn the process if necessary
769-
if not context.is_shutdown and not self.__shutdown_future.done() and self.__respawn:
769+
if not context.is_shutdown and not self.__shutdown_future.done() and self.__respawn and returncode != 0:
770770
if self.__respawn_delay is not None and self.__respawn_delay > 0.0:
771771
# wait for a timeout(`self.__respawn_delay`) to respawn the process
772772
# and handle shutdown event with future(`self.__shutdown_future`)

0 commit comments

Comments
 (0)