-
Notifications
You must be signed in to change notification settings - Fork 229
[APIView] Fix background service crashing APIView #13469
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -70,6 +70,13 @@ public Startup(IConfiguration configuration, IWebHostEnvironment environment) | |
| // This method gets called by the runtime. Use this method to add services to the container. | ||
| public void ConfigureServices(IServiceCollection services) | ||
| { | ||
| // Configure host options to prevent background service exceptions from crashing the app | ||
| services.Configure<HostOptions>(options => | ||
| { | ||
| options.BackgroundServiceExceptionBehavior = BackgroundServiceExceptionBehavior.Ignore; | ||
|
||
| options.ShutdownTimeout = TimeSpan.FromSeconds(30); | ||
| }); | ||
|
|
||
| services.AddApplicationInsightsTelemetry(); | ||
| services.AddApplicationInsightsTelemetryProcessor<TelemetryIpAddressFilter>(); | ||
| services.AddAzureAppConfiguration(); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are we running this in loop? This is a onetime task to update reviews when a new version is deployed. right?