This commit is contained in:
@@ -116,11 +116,11 @@ namespace AyaNova.Biz
|
||||
private static async Task DeliverCustomerNotificationSMTP(CustomerNotifyEvent ne, CustomerNotifySubscription subscription, string deliveryAddress, AyContext ct)
|
||||
{
|
||||
|
||||
var DeliveryLogItem = new NotifyDeliveryLog()
|
||||
var DeliveryLogItem = new CustomerNotifyDeliveryLog()
|
||||
{
|
||||
Processed = DateTime.UtcNow,
|
||||
ObjectId = ne.ObjectId,
|
||||
NotifySubscriptionId = ne.CustomerNotifySubscriptionId,
|
||||
CustomerNotifySubscriptionId = ne.CustomerNotifySubscriptionId,
|
||||
Fail = false
|
||||
};
|
||||
|
||||
@@ -288,7 +288,7 @@ namespace AyaNova.Biz
|
||||
ct.CustomerNotifyEvent.Remove(ne);
|
||||
|
||||
//add delivery log item
|
||||
await ct.NotifyDeliveryLog.AddAsync(DeliveryLogItem);
|
||||
await ct.CustomerNotifyDeliveryLog.AddAsync(DeliveryLogItem);
|
||||
await ct.SaveChangesAsync();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,6 +45,10 @@ namespace AyaNova.Biz
|
||||
//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}");
|
||||
|
||||
//CustomerNotifyDeliveryLog - deletes all log items older than 90 days
|
||||
await ct.Database.ExecuteSqlInterpolatedAsync($"delete from acustomernotifydeliverylog where processed < {dtDeleteCutoff}");
|
||||
|
||||
|
||||
}
|
||||
lastSweep = DateTime.UtcNow;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user