修改 CloudProduct ImageCache 项目改为 插件
This commit is contained in:
1 parent
5ff52dea92
commit
292cb8638c
26 files changed
+417
-282
No files matched your search
@@ -0,0 +1,22 @@
|
||||
using Microsoft.Extensions.Hosting;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace Store.Modules.CloudProduct.Services;
|
||||
|
||||
/// <summary>查询搜索服务状态;网络不可用时记录错误,不阻止 HTTP 服务启动。</summary>
|
||||
internal sealed class CloudProductSearchStartup(
|
||||
IOpenSearchService search, ILogger<CloudProductSearchStartup> logger) : BackgroundService
|
||||
{
|
||||
protected override async Task ExecuteAsync(CancellationToken stoppingToken)
|
||||
{
|
||||
try
|
||||
{
|
||||
await search.GetStatusAsync().WaitAsync(stoppingToken);
|
||||
}
|
||||
catch (OperationCanceledException) when (stoppingToken.IsCancellationRequested) { }
|
||||
catch (Exception ex)
|
||||
{
|
||||
logger.LogWarning(ex, "CloudProduct 搜索服务启动检查失败。");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user