scp 服务记录日志修改

Test_HIR_Net8
hang 2025-09-17 10:49:16 +08:00
parent 67e7eaaa96
commit f9d69995d3
1 changed files with 25 additions and 12 deletions

View File

@ -166,6 +166,16 @@ namespace IRaCIS.Core.SCP.Service
await DataMaintenanceAsaync();
await AddUploadLogAsync();
}
await SendAssociationReleaseResponseAsync();
}
private async Task AddUploadLogAsync()
{
//记录监控
var _SCPImageUploadRepository = _serviceProvider.GetService<IRepository<SCPImageUpload>>();
@ -177,10 +187,6 @@ namespace IRaCIS.Core.SCP.Service
//可能是测试echo 导致记录了
await _SCPImageUploadRepository.AddAsync(_upload, _upload.FileCount > 0 ? true : false);
}
await SendAssociationReleaseResponseAsync();
}
@ -251,6 +257,13 @@ namespace IRaCIS.Core.SCP.Service
await _studyRepository.SaveChangesAndClearAllTrackingAsync();
}
else
{
//记录日志
await AddUploadLogAsync();
}
Log.Logger.Warning($"连接关闭 {exception?.Message} {exception?.InnerException?.Message}");
}