|
|
|
@ -536,7 +536,7 @@ public class DiamondSelectVM : BaseViewModel |
|
|
|
|
/// |
|
|
|
|
private static readonly ILog Logger = LogManager.GetLogger(typeof(AlgorithmServer)); |
|
|
|
|
[Log] |
|
|
|
|
private void HandleAlgorithmFailure(string image_files, string dCode = "") |
|
|
|
|
public static void HandleAlgorithmFailure(string[] image_files, string dCode = "") |
|
|
|
|
{ |
|
|
|
|
|
|
|
|
|
// 从配置文件中读取 imageHistoryPath |
|
|
|
@ -554,8 +554,11 @@ public class DiamondSelectVM : BaseViewModel |
|
|
|
|
string newFolderPath = Path.Combine(imageHistoryPath, string.IsNullOrWhiteSpace(dCode) ? $"image-{timestamp}" : $"image-{dCode}-{timestamp}" ); |
|
|
|
|
|
|
|
|
|
// 检查 D 盘内存空间 |
|
|
|
|
DriveInfo dDrive = new DriveInfo("D"); |
|
|
|
|
long requiredSpace = 10L * 1024 * 1024 * 1024; // 10GB |
|
|
|
|
string strSafeSpace = ConfigurationHelper.ReadConfigValue("SafeSpaceReservation"); |
|
|
|
|
long safeSpace = 10L; |
|
|
|
|
long.TryParse(strSafeSpace, out safeSpace); |
|
|
|
|
DriveInfo dDrive = new DriveInfo(imageHistoryPath.Substring(0,1)); |
|
|
|
|
long requiredSpace = safeSpace * 1024 * 1024 * 1024; |
|
|
|
|
if (dDrive.TotalFreeSpace < requiredSpace) |
|
|
|
|
{ |
|
|
|
|
// 如果 D 盘空间不足 10GB,删除最早创建的10个文件夹 |
|
|
|
@ -582,8 +585,9 @@ public class DiamondSelectVM : BaseViewModel |
|
|
|
|
try |
|
|
|
|
{ |
|
|
|
|
// 解析 image_files JSON 数组 |
|
|
|
|
JArray imageFilesArray = JArray.Parse(image_files); |
|
|
|
|
string[] imageFiles = imageFilesArray.Select(token => token.ToString()).ToArray(); |
|
|
|
|
// JArray imageFilesArray = JArray.Parse(image_files); |
|
|
|
|
// string[] imageFiles = imageFilesArray.Select(token => token.ToString()).ToArray(); |
|
|
|
|
string[] imageFiles = image_files; |
|
|
|
|
|
|
|
|
|
string? imageBasePath = ConfigurationManager.AppSettings["ImageFileBasePath"]; // 图片根目录 |
|
|
|
|
if (string.IsNullOrEmpty(imageBasePath)) |
|
|
|
|