清楚dir缓存修改
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
5fb889bac9
commit
0afcaa7d70
|
|
@ -394,7 +394,7 @@ namespace IRaCIS.Core.SCP.Service
|
||||||
{
|
{
|
||||||
var pid = dataset.GetSingleValueOrDefault(DicomTag.PatientID, string.Empty);
|
var pid = dataset.GetSingleValueOrDefault(DicomTag.PatientID, string.Empty);
|
||||||
|
|
||||||
dataset.AddOrUpdate(DicomTag.PatientID, trialSiteInfo.TrialCode + "_" + pid);
|
dataset.AddOrUpdate(DicomTag.PatientID, trialSiteInfo.TrialCode + "-" + pid);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -160,7 +160,7 @@ public interface IOSSService
|
||||||
|
|
||||||
public Task DeleteFromPrefix(string prefix, bool isCache = false);
|
public Task DeleteFromPrefix(string prefix, bool isCache = false);
|
||||||
|
|
||||||
public Task DeleteObjects(List<string> objectKeys);
|
public Task DeleteObjects(List<string> objectKeys, bool isCache = false);
|
||||||
|
|
||||||
List<string> GetRootFolderNames();
|
List<string> GetRootFolderNames();
|
||||||
|
|
||||||
|
|
@ -1591,7 +1591,7 @@ public class OSSService : IOSSService
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task DeleteObjects(List<string> objectKeys)
|
public async Task DeleteObjects(List<string> objectKeys, bool isCache = false)
|
||||||
{
|
{
|
||||||
GetObjectStoreTempToken();
|
GetObjectStoreTempToken();
|
||||||
|
|
||||||
|
|
@ -1601,9 +1601,23 @@ public class OSSService : IOSSService
|
||||||
|
|
||||||
var _ossClient = new OssClient(RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? aliConfig.EndPoint : aliConfig.InternalEndpoint, AliyunOSSTempToken.AccessKeyId, AliyunOSSTempToken.AccessKeySecret, AliyunOSSTempToken.SecurityToken);
|
var _ossClient = new OssClient(RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? aliConfig.EndPoint : aliConfig.InternalEndpoint, AliyunOSSTempToken.AccessKeyId, AliyunOSSTempToken.AccessKeySecret, AliyunOSSTempToken.SecurityToken);
|
||||||
|
|
||||||
|
var bucketName = string.Empty;
|
||||||
|
|
||||||
|
if (isCache)
|
||||||
|
{
|
||||||
|
Uri uri = new Uri(aliConfig.ViewEndpoint);
|
||||||
|
string host = uri.Host; // 获取 "zy-irc-test-dev-cache.oss-cn-shanghai.aliyuncs.com"
|
||||||
|
string[] parts = host.Split('.');
|
||||||
|
bucketName = parts[0];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
bucketName = aliConfig.BucketName;
|
||||||
|
}
|
||||||
|
|
||||||
if (objectKeys.Count > 0)
|
if (objectKeys.Count > 0)
|
||||||
{
|
{
|
||||||
var result = _ossClient.DeleteObjects(new Aliyun.OSS.DeleteObjectsRequest(aliConfig.BucketName, objectKeys, false));
|
var result = _ossClient.DeleteObjects(new Aliyun.OSS.DeleteObjectsRequest(bucketName, objectKeys, false));
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -95,6 +95,18 @@ namespace IRaCIS.Core.Application.Service
|
||||||
return ResponseOutput.Ok();
|
return ResponseOutput.Ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[AllowAnonymous]
|
||||||
|
|
||||||
|
public async Task<IResponseOutput> DeleteCacheDIR()
|
||||||
|
{
|
||||||
|
var list= _dicomStudyRepository.Where(t => t.StudyDIRPath!="").Select(t => t.StudyDIRPath).ToList();
|
||||||
|
|
||||||
|
|
||||||
|
await _IOSSService.DeleteObjects(list.Select(t => t.TrimStart('/')).ToList(),true);
|
||||||
|
|
||||||
|
return ResponseOutput.Ok();
|
||||||
|
}
|
||||||
|
|
||||||
[AllowAnonymous]
|
[AllowAnonymous]
|
||||||
public async Task<IResponseOutput> TestOSS(StorageClass storageClass)
|
public async Task<IResponseOutput> TestOSS(StorageClass storageClass)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue