Cleanup RIFE crash dumps

This commit is contained in:
N00MKRAD
2023-12-21 05:02:03 +01:00
parent da8a431545
commit 2eff92958f
2 changed files with 3 additions and 0 deletions

View File

@@ -288,8 +288,10 @@ namespace Flowframes
public static async Task Cleanup(bool ignoreKeepSetting = false, int retriesLeft = 3, bool isRetry = false) public static async Task Cleanup(bool ignoreKeepSetting = false, int retriesLeft = 3, bool isRetry = false)
{ {
if ((!ignoreKeepSetting && Config.GetBool(Config.Key.keepTempFolder)) || !Program.busy) return; if ((!ignoreKeepSetting && Config.GetBool(Config.Key.keepTempFolder)) || !Program.busy) return;
if (!isRetry) if (!isRetry)
Logger.Log("Deleting temporary files..."); Logger.Log("Deleting temporary files...");
try try
{ {
await Task.Run(async () => { Directory.Delete(currentSettings.tempFolder, true); }); await Task.Run(async () => { Directory.Delete(currentSettings.tempFolder, true); });

View File

@@ -122,6 +122,7 @@ namespace Flowframes
} }
IoUtils.GetFilesSorted(Paths.GetPkgPath(), false, "*.log*").ToList().ForEach(x => IoUtils.TryDeleteIfExists(x)); IoUtils.GetFilesSorted(Paths.GetPkgPath(), false, "*.log*").ToList().ForEach(x => IoUtils.TryDeleteIfExists(x));
IoUtils.GetFilesSorted(Path.Combine(Environment.ExpandEnvironmentVariables("%LOCALAPPDATA%"), "CrashDumps"), false, "rife*.exe.*.dmp").ToList().ForEach(x => IoUtils.TryDeleteIfExists(x));
} }
catch (Exception e) catch (Exception e)
{ {