Skip to content

Commit

Permalink
Make the process exit with the correct exit code. (#617)
Browse files Browse the repository at this point in the history
* Make the process exit with the correct exit code.

* Add Environment.Exit(Environment.ExitCode); to the different services.

---------

Co-authored-by: Sarah Oslund <[email protected]>
  • Loading branch information
gustavoaca1997 and sfoslund authored Jul 17, 2024
1 parent 7d4f718 commit 91b1b41
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/Microsoft.Sbom.Tool/FormatValidationService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ public async Task StartAsync(CancellationToken cancellationToken)
}

hostApplicationLifetime.StopApplication();
Environment.Exit(Environment.ExitCode);
}

public Task StopAsync(CancellationToken cancellationToken)
Expand Down
1 change: 1 addition & 0 deletions src/Microsoft.Sbom.Tool/GenerationService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ public async Task StartAsync(CancellationToken cancellationToken)
}

hostApplicationLifetime.StopApplication();
Environment.Exit(Environment.ExitCode);
}

public Task StopAsync(CancellationToken cancellationToken)
Expand Down
1 change: 1 addition & 0 deletions src/Microsoft.Sbom.Tool/RedactService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ public async Task StartAsync(CancellationToken cancellationToken)
}

hostApplicationLifetime.StopApplication();
Environment.Exit(Environment.ExitCode);
}

public Task StopAsync(CancellationToken cancellationToken)
Expand Down
1 change: 1 addition & 0 deletions src/Microsoft.Sbom.Tool/ValidationService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ public async Task StartAsync(CancellationToken cancellationToken)
}

hostApplicationLifetime.StopApplication();
Environment.Exit(Environment.ExitCode);
}

public Task StopAsync(CancellationToken cancellationToken)
Expand Down

0 comments on commit 91b1b41

Please sign in to comment.