From a5747560c58ef8abeed89ac79bd87587cd035500 Mon Sep 17 00:00:00 2001 From: Laura Hausmann Date: Fri, 29 Jan 2021 23:00:35 +0100 Subject: [PATCH] Add redis --- bahnplan.web/Program.cs | 2 ++ bahnplan.web/Startup.cs | 10 ++++++++++ bahnplan.web/bahnplan.web.csproj | 1 + 3 files changed, 13 insertions(+) diff --git a/bahnplan.web/Program.cs b/bahnplan.web/Program.cs index 9bae3bb..c1ae6c0 100644 --- a/bahnplan.web/Program.cs +++ b/bahnplan.web/Program.cs @@ -1,4 +1,5 @@ using System.IO; +using System.Threading; using bahnplan.web.database; using LinqToDB.Common; using LinqToDB.Data; @@ -11,6 +12,7 @@ namespace bahnplan.web { DataConnection.DefaultSettings = new Database.Settings(); Configuration.Linq.AllowMultipleQuery = true; Directory.CreateDirectory(Variables.TicketDir); + ThreadPool.SetMinThreads(100,100); CreateHostBuilder(args).Build().Run(); } diff --git a/bahnplan.web/Startup.cs b/bahnplan.web/Startup.cs index 980378e..ac6d59b 100644 --- a/bahnplan.web/Startup.cs +++ b/bahnplan.web/Startup.cs @@ -21,8 +21,18 @@ namespace bahnplan.web { }); #if (DEBUG) services.AddControllers().AddRazorRuntimeCompilation(); + services.AddControllers(); + services.AddStackExchangeRedisCache(options => { + options.Configuration = "localhost"; + options.InstanceName = "bahnplan_development"; + }); #else services.AddControllers(); + services.AddStackExchangeRedisCache(options => + { + options.Configuration = "localhost"; + options.InstanceName = "bahnplan_production"; + }); #endif } diff --git a/bahnplan.web/bahnplan.web.csproj b/bahnplan.web/bahnplan.web.csproj index 782cd17..e74f4c7 100644 --- a/bahnplan.web/bahnplan.web.csproj +++ b/bahnplan.web/bahnplan.web.csproj @@ -73,6 +73,7 @@ +