mirror of
https://github.com/Caraxi/mare.server.git
synced 2025-12-29 21:33:38 +01:00
add blocking detection nuget
This commit is contained in:
parent
78543d0fc2
commit
1a22846eea
4 changed files with 6 additions and 26 deletions
|
|
@ -17,6 +17,7 @@ using Microsoft.AspNetCore.Authorization;
|
|||
using MareSynchronosServer.Discord;
|
||||
using AspNetCoreRateLimit;
|
||||
using MareSynchronosServer.Throttling;
|
||||
using Ben.Diagnostics;
|
||||
|
||||
namespace MareSynchronosServer
|
||||
{
|
||||
|
|
@ -48,11 +49,11 @@ namespace MareSynchronosServer
|
|||
|
||||
services.AddDbContextPool<MareDbContext>(options =>
|
||||
{
|
||||
options.EnableThreadSafetyChecks(false);
|
||||
options.UseNpgsql(Configuration.GetConnectionString("DefaultConnection"), builder =>
|
||||
{
|
||||
builder.MigrationsHistoryTable("_efmigrationshistory", "public");
|
||||
}).UseSnakeCaseNamingConvention();
|
||||
options.EnableThreadSafetyChecks(false);
|
||||
}, Configuration.GetValue("DbContextPoolSize", 1024));
|
||||
|
||||
services.AddHostedService<CleanupService>();
|
||||
|
|
@ -81,6 +82,7 @@ namespace MareSynchronosServer
|
|||
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
|
||||
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
|
||||
{
|
||||
app.UseBlockingDetection();
|
||||
|
||||
if (env.IsDevelopment())
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue