Skip to content

Commit

Permalink
Merge pull request #261 from hrntsm/fix/tmp-file-delete-error
Browse files Browse the repository at this point in the history
Fix temp file delete error
  • Loading branch information
hrntsm authored Mar 8, 2024
2 parents 7b9588a + fa106b4 commit 638d339
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
1 change: 0 additions & 1 deletion Tunny/Solver/Algorithm.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading;
Expand Down
19 changes: 15 additions & 4 deletions Tunny/Solver/Solver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,22 @@ private static void InitializeTmpDir()
TLog.Info("Create tmp folder");
Directory.CreateDirectory(TEnvVariables.TmpDirPath);
}
TLog.Info("Clean tmp files");
var tmpDir = new DirectoryInfo(TEnvVariables.TmpDirPath);
foreach (FileInfo file in tmpDir.GetFiles())
else
{
file.Delete();
TLog.Info("Start clean tmp files");
var tmpDir = new DirectoryInfo(TEnvVariables.TmpDirPath);
foreach (FileInfo file in tmpDir.GetFiles())
{
try
{
file.Delete();
}
catch (Exception e)
{
TLog.Error(e.Message);
}
}
TLog.Info("Finish clean tmp files");
}
}

Expand Down

0 comments on commit 638d339

Please sign in to comment.