Skip to content

Commit

Permalink
move files cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
stefansjfw committed Sep 16, 2024
1 parent c9c9b7b commit 2d5faa7
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/settings-ui/Settings.UI/ViewModels/GeneralViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,10 @@ public GeneralViewModel(ISettingsRepository<GeneralSettings> settingsRepository,
{
_fileWatcher = Helper.GetFileWatcher(string.Empty, UpdatingSettings.SettingsFile, dispatcherAction);
}

// Diagnostic data retention policy
string etwDirPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "Microsoft\\PowerToys\\etw");
DeleteDiagnosticDataOlderThan28Days(etwDirPath);
}

private static bool _isDevBuild;
Expand Down Expand Up @@ -1095,9 +1099,6 @@ internal void ViewDiagnosticData()
string etwDirPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "Microsoft\\PowerToys\\etw");
string tracerptPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Windows), "system32");

// Retention policy
DeleteDiagnosticDataOlderThan28Days(etwDirPath);

ETLConverter converter = new ETLConverter(etwDirPath, tracerptPath);
Task.Run(() => converter.ConvertDiagnosticsETLsAsync()).Wait();

Expand Down

0 comments on commit 2d5faa7

Please sign in to comment.