本地启动项目,直接跳过同步任务,不影响线上任务,否则会重复
continuous-integration/drone/push Build is passing

This commit is contained in:
2026-04-10 14:24:56 +08:00
parent 6c1c46601c
commit 6633e26175
4 changed files with 23 additions and 2 deletions
@@ -9,6 +9,7 @@ using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
using System;
using System.Linq;
using System.Runtime.InteropServices;
using System.Threading;
using System.Threading.Tasks;
@@ -27,7 +28,13 @@ public class SyncFileRecoveryService(IServiceScopeFactory _scopeFactory, FileSyn
/// <returns></returns>
protected override async Task ExecuteAsync(CancellationToken stoppingToken)
{
using var scope = _scopeFactory.CreateScope();
//在本地调试的时候,不干涉部署同步任务
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
return;
}
using var scope = _scopeFactory.CreateScope();
var fileUploadRecordRepository = scope.ServiceProvider.GetRequiredService<IRepository<FileUploadRecord>>();
// 延迟启动,保证主机快速启动
+7
View File
@@ -344,6 +344,13 @@
</summary>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.API.HostService.SyncFileRecoveryService.ExecuteAsync(System.Threading.CancellationToken)">
<summary>
多个程序,如果恢复同一份数据,造成重复同步,SCP服务不恢复任务
</summary>
<param name="stoppingToken"></param>
<returns></returns>
</member>
<member name="T:IRaCIS.Core.API.IpPolicyRateLimitSetup">
<summary>
IPLimit限流 启动服务