Fixing a timezone issue

pull/5050/head
David Benson 5 months ago
parent afcb32c200
commit 49102ba61c
No known key found for this signature in database
GPG Key ID: AEB25FAA80437D26

@ -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…
Cancel
Save