Fixed: Initialize databases after app folder migrations

Co-authored-by: Mark McDowall <mark@mcdowall.ca>
This commit is contained in:
Bogdan 2024-05-01 21:19:05 +03:00 committed by Mark McDowall
parent 73a4bdea52
commit 128309068d
2 changed files with 5 additions and 3 deletions

View File

@ -23,7 +23,6 @@ using NzbDrone.Common.Instrumentation.Extensions;
using NzbDrone.Common.Options;
using NzbDrone.Core.Configuration;
using NzbDrone.Core.Datastore.Extensions;
using Sonarr.Http.ClientSchema;
using LogLevel = Microsoft.Extensions.Logging.LogLevel;
using PostgresOptions = NzbDrone.Core.Datastore.PostgresOptions;
@ -171,8 +170,6 @@ namespace NzbDrone.Host
{
c.AddDummyLogDatabase();
}
SchemaBuilder.Initialize(c);
})
.ConfigureServices(services =>
{

View File

@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.IO;
using DryIoc;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.DataProtection;
@ -26,6 +27,7 @@ using NzbDrone.SignalR;
using Sonarr.Api.V3.System;
using Sonarr.Http;
using Sonarr.Http.Authentication;
using Sonarr.Http.ClientSchema;
using Sonarr.Http.ErrorManagement;
using Sonarr.Http.Frontend;
using Sonarr.Http.Middleware;
@ -193,6 +195,7 @@ namespace NzbDrone.Host
}
public void Configure(IApplicationBuilder app,
IContainer container,
IStartupContext startupContext,
Lazy<IMainDatabase> mainDatabaseFactory,
Lazy<ILogDatabase> logDatabaseFactory,
@ -227,6 +230,8 @@ namespace NzbDrone.Host
dbTarget.Register();
}
SchemaBuilder.Initialize(container);
if (OsInfo.IsNotWindows)
{
Console.CancelKeyPress += (sender, eventArgs) => NLog.LogManager.Configuration = null;