Skip to content

Commit

Permalink
v5.11.1
Browse files Browse the repository at this point in the history
  • Loading branch information
trueai-org committed Nov 7, 2024
1 parent 7e48af7 commit 9864b11
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 25 deletions.
48 changes: 26 additions & 22 deletions src/Midjourney.API/DiscordAccountInitializer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -585,6 +585,8 @@ public async Task StartCheckAccount(DiscordAccount account, bool isValidateLock

var isLock = await AsyncLocalLock.TryLockAsync($"initialize:{account.Id}", TimeSpan.FromSeconds(5), async () =>
{
var setting = GlobalConfiguration.Setting;

var sw = new Stopwatch();
var swAll = new Stopwatch();

Expand Down Expand Up @@ -647,7 +649,7 @@ public async Task StartCheckAccount(DiscordAccount account, bool isValidateLock
}
}

var setting = GlobalConfiguration.Setting;


// 启用自动获取私信 ID
if (setting.EnableAutoGetPrivateId)
Expand Down Expand Up @@ -726,25 +728,23 @@ public async Task StartCheckAccount(DiscordAccount account, bool isValidateLock
// 多账号启动时,等待一段时间再启动下一个账号
await Task.Delay(1000 * 5);

// 启用自动同步信息和设置
if (setting.EnableAutoSyncInfoSetting)
{
try
{
// 启动后执行 info setting 操作
await _taskService.InfoSetting(account.Id);
}
catch (Exception ex)
{
_logger.Error(ex, "同步 info 异常 {@0}", account.ChannelId);

info.AppendLine($"{account.Id}初始化中... 同步 info 异常");
}
try
{
// 启动后执行 info setting 操作
await _taskService.InfoSetting(account.Id);
}
catch (Exception ex)
{
_logger.Error(ex, "同步 info 异常 {@0}", account.ChannelId);

sw.Stop();
info.AppendLine($"{account.Id}初始化中... 同步 info 耗时: {sw.ElapsedMilliseconds}ms");
sw.Restart();
info.AppendLine($"{account.Id}初始化中... 同步 info 异常");
}

sw.Stop();
info.AppendLine($"{account.Id}初始化中... 同步 info 耗时: {sw.ElapsedMilliseconds}ms");
sw.Restart();

}

// 慢速切换快速模式检查
Expand All @@ -756,11 +756,15 @@ public async Task StartCheckAccount(DiscordAccount account, bool isValidateLock
sw.Restart();
}

// 每 6~12 小时,同步账号信息
await disInstance?.RandomSyncInfo();
sw.Stop();
info.AppendLine($"{account.Id}初始化中... 随机同步信息耗时: {sw.ElapsedMilliseconds}ms");
sw.Restart();
// 启用自动同步信息和设置
if (setting.EnableAutoSyncInfoSetting)
{
// 每 6~12 小时,同步账号信息
await disInstance?.RandomSyncInfo();
sw.Stop();
info.AppendLine($"{account.Id}初始化中... 随机同步信息耗时: {sw.ElapsedMilliseconds}ms");
sw.Restart();
}
}
else
{
Expand Down
2 changes: 1 addition & 1 deletion src/Midjourney.API/wwwroot/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
</head>
<body>
<div id="root"></div>
<script src="/umi.3acc1897.js"></script>
<script src="/umi.7f59935f.js"></script>
</body>
</html>

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/Midjourney.Infrastructure/GlobalConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public class GlobalConfiguration
/// <summary>
/// 版本号
/// </summary>
public static string Version { get; set; } = "v5.11.0";
public static string Version { get; set; } = "v5.11.1";

/// <summary>
/// 全局配置项
Expand Down

0 comments on commit 9864b11

Please sign in to comment.