Add redis
This commit is contained in:
parent
531276c3cd
commit
a5747560c5
|
@ -1,4 +1,5 @@
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
using System.Threading;
|
||||||
using bahnplan.web.database;
|
using bahnplan.web.database;
|
||||||
using LinqToDB.Common;
|
using LinqToDB.Common;
|
||||||
using LinqToDB.Data;
|
using LinqToDB.Data;
|
||||||
|
@ -11,6 +12,7 @@ namespace bahnplan.web {
|
||||||
DataConnection.DefaultSettings = new Database.Settings();
|
DataConnection.DefaultSettings = new Database.Settings();
|
||||||
Configuration.Linq.AllowMultipleQuery = true;
|
Configuration.Linq.AllowMultipleQuery = true;
|
||||||
Directory.CreateDirectory(Variables.TicketDir);
|
Directory.CreateDirectory(Variables.TicketDir);
|
||||||
|
ThreadPool.SetMinThreads(100,100);
|
||||||
CreateHostBuilder(args).Build().Run();
|
CreateHostBuilder(args).Build().Run();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -21,8 +21,18 @@ namespace bahnplan.web {
|
||||||
});
|
});
|
||||||
#if (DEBUG)
|
#if (DEBUG)
|
||||||
services.AddControllers().AddRazorRuntimeCompilation();
|
services.AddControllers().AddRazorRuntimeCompilation();
|
||||||
|
services.AddControllers();
|
||||||
|
services.AddStackExchangeRedisCache(options => {
|
||||||
|
options.Configuration = "localhost";
|
||||||
|
options.InstanceName = "bahnplan_development";
|
||||||
|
});
|
||||||
#else
|
#else
|
||||||
services.AddControllers();
|
services.AddControllers();
|
||||||
|
services.AddStackExchangeRedisCache(options =>
|
||||||
|
{
|
||||||
|
options.Configuration = "localhost";
|
||||||
|
options.InstanceName = "bahnplan_production";
|
||||||
|
});
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -73,6 +73,7 @@
|
||||||
<PackageReference Include="linq2db" Version="2.9.8" />
|
<PackageReference Include="linq2db" Version="2.9.8" />
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="3.1.4" />
|
<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="3.1.4" />
|
||||||
<PackageReference Include="Microsoft.Data.Sqlite" Version="3.1.4" />
|
<PackageReference Include="Microsoft.Data.Sqlite" Version="3.1.4" />
|
||||||
|
<PackageReference Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="5.0.1" />
|
||||||
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
|
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
|
||||||
<PackageReference Include="System.Reflection.TypeExtensions" Version="4.7.0" />
|
<PackageReference Include="System.Reflection.TypeExtensions" Version="4.7.0" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
Reference in a new issue