Separate configuration settings
Added EAFLog Testing Stratus file
This commit is contained in:
27
Helpers/HelperEAFLog.cs
Normal file
27
Helpers/HelperEAFLog.cs
Normal file
@ -0,0 +1,27 @@
|
||||
using File_Watcher.Models;
|
||||
|
||||
namespace File_Watcher.Helpers;
|
||||
|
||||
internal static partial class HelperEAFLog
|
||||
{
|
||||
|
||||
internal static bool DeleteFiles(AppSettings appSettings, ILogger<Worker> logger)
|
||||
{
|
||||
IEnumerable<string> files = Directory.EnumerateFiles(appSettings.WatchDirectory, appSettings.EAFLogConfiguration.SearchPattern, SearchOption.AllDirectories);
|
||||
foreach (string file in files)
|
||||
{
|
||||
if (file.EndsWith(".dll"))
|
||||
continue;
|
||||
if (file.EndsWith(".pdb"))
|
||||
continue;
|
||||
if (file.EndsWith(".xml"))
|
||||
continue;
|
||||
try
|
||||
{ File.Delete(file); }
|
||||
catch (Exception ex)
|
||||
{ logger.LogError(ex, "Inner loop error!"); }
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user