This commit is contained in:
2021-08-03 00:47:46 +00:00
parent bff537aa72
commit ce663cc36b
2 changed files with 10 additions and 3 deletions

View File

@@ -14,7 +14,7 @@ namespace AyaNova.Biz
{
private static ILogger log = AyaNova.Util.ApplicationLogging.CreateLogger("CoreNotificationSweeper");
private static DateTime lastSweep = DateTime.MinValue;
private static TimeSpan DELETE_AFTER_AGE = new TimeSpan(90, 0, 0, 0);
private static TimeSpan DELETE_AFTER_AGE = new TimeSpan(90, 0, 0, 0);//## WARNING CoreJobPMInventoryCheck EXPECTS THIS TO BE a pretty big value 90 days right now
private static TimeSpan SWEEP_EVERY_INTERVAL = new TimeSpan(8, 0, 0);//once every 8 hours, three times a day
////////////////////////////////////////////////////////////////////////////////////////////////
@@ -42,6 +42,7 @@ namespace AyaNova.Biz
await ct.Database.ExecuteSqlInterpolatedAsync($"delete from anotifyevent where eventdate < {dtPastEventCutoff} and created < {dtDeleteCutoff}");
//NotifyDeliveryLog - deletes all log items older than 90 days (NOTE: this log is also used to identify and prevent high frequency repetitive dupes)
//Note: also has bearing on CoreJobPMInventoryCheck which uses notifydeliverylog to check if pm inventory notify has been done it's one time already
await ct.Database.ExecuteSqlInterpolatedAsync($"delete from anotifydeliverylog where processed < {dtDeleteCutoff}");
}