From 584814bdfbe367a5a444fc14236c43fcd826909e Mon Sep 17 00:00:00 2001 From: trueai-org Date: Fri, 22 Nov 2024 14:41:00 +0800 Subject: [PATCH] v6.0.0-beta.8 --- src/Midjourney.API/DiscordAccountInitializer.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Midjourney.API/DiscordAccountInitializer.cs b/src/Midjourney.API/DiscordAccountInitializer.cs index cb89ad4a..b076ac13 100644 --- a/src/Midjourney.API/DiscordAccountInitializer.cs +++ b/src/Midjourney.API/DiscordAccountInitializer.cs @@ -26,6 +26,7 @@ using Microsoft.Extensions.Options; using Midjourney.Infrastructure.Data; using Midjourney.Infrastructure.LoadBalancer; +using Midjourney.Infrastructure.Models; using Midjourney.Infrastructure.Services; using Midjourney.Infrastructure.Util; using MongoDB.Driver; @@ -174,7 +175,12 @@ public async Task StartAsync(CancellationToken cancellationToken) } catch (Exception ex) { - _logger.Error(ex, "本地存储迁移到 mongodb 异常"); + _logger.Error(ex, "本地存储迁移到 mongodb 异常,已重置为本地数据库"); + + // 如果出现异常,则重置为本地存储 + GlobalConfiguration.Setting.MongoDefaultConnectionString = ""; + + LiteDBHelper.SettingStore.Save(GlobalConfiguration.Setting); } }