mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-21 22:03:15 -07:00
Fixing a timezone issue
This commit is contained in:
parent
afcb32c200
commit
49102ba61c
2 changed files with 18 additions and 1 deletions
17
src/Ombi.Store/Context/Postgres/PostgresModuleInitializer.cs
Normal file
17
src/Ombi.Store/Context/Postgres/PostgresModuleInitializer.cs
Normal file
|
@ -0,0 +1,17 @@
|
|||
using System;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
namespace Ombi.Store.Context.Postgres;
|
||||
|
||||
public static class PostgresModuleInitializer
|
||||
{
|
||||
#pragma warning disable CA2255
|
||||
// This is required to ensure that Npgsql uses a timestamp behavior that does not require a timezone
|
||||
// Reference: https://stackoverflow.com/a/73586129
|
||||
[ModuleInitializer]
|
||||
#pragma warning restore CA2255
|
||||
public static void Initialize()
|
||||
{
|
||||
AppContext.SetSwitch("Npgsql.EnableLegacyTimestampBehavior", true);
|
||||
}
|
||||
}
|
|
@ -120,6 +120,7 @@ namespace Ombi
|
|||
|
||||
serviceProvider.UseQuartz().GetAwaiter().GetResult();
|
||||
|
||||
AppContext.SetSwitch("Npgsql.EnableLegacyTimestampBehavior", true);
|
||||
var ctx = serviceProvider.GetService<OmbiContext>();
|
||||
loggerFactory.AddSerilog();
|
||||
var ombiService =
|
||||
|
@ -151,7 +152,6 @@ namespace Ombi
|
|||
{
|
||||
app.UsePathBase(settings.BaseUrl);
|
||||
}
|
||||
|
||||
ctx.Seed();
|
||||
var settingsctx = serviceProvider.GetService<SettingsContext>();
|
||||
settingsctx.Seed();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue