Skip to content
This repository has been archived by the owner on Aug 28, 2024. It is now read-only.

Commit

Permalink
fix: Prevent bloating of LoadedCustomRotations whenever a change was …
Browse files Browse the repository at this point in the history
…detected.
  • Loading branch information
RiotNOR committed May 15, 2023
1 parent cd91989 commit af170cd
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
3 changes: 3 additions & 0 deletions RotationSolver/RotationHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,9 @@ public static Assembly LoadFrom(string filePath)
var loaded = new LoadedAssembly();
loaded.Path = filePath;
loaded.LastModified = File.GetLastWriteTimeUtc(filePath).ToString();

var idx = LoadedCustomRotations.FindIndex(item => item.Path == loaded.Path);
if (idx != -1) LoadedCustomRotations.RemoveAt(idx);
LoadedCustomRotations.Add(loaded);

return assembly;
Expand Down
9 changes: 9 additions & 0 deletions RotationSolver/Updaters/RotationUpdater.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using Dalamud.Logging;
using Lumina.Excel.GeneratedSheets;

using RotationSolver.Localization;
using System.Text;

Expand Down Expand Up @@ -222,6 +224,13 @@ public static void LocalRotationWatcher()
}
}

foreach (var item in RotationHelper.LoadedCustomRotations)
{
PluginLog.LogWarning("Loaded: " + item.Path);
}

PluginLog.LogWarning("----------------------------");

LastRunTime = DateTime.Now;
}

Expand Down

0 comments on commit af170cd

Please sign in to comment.