Rank: Advanced Member
Groups: HelpDesk, Developers Joined: 11/9/2018(UTC) Posts: 564
Thanks: 122 times Was thanked: 26 time(s) in 25 post(s)
|
Not major. The code seems oddly written. First it looks at a record count for 4 months worth of data, but then only actually trims 3 months worth: Code:
protected virtual void MaintainAuditLog()
{
DateTime utcDayStart = new DateTime(DateTime.UtcNow.Year, DateTime.UtcNow.Month, DateTime.UtcNow.Day, 0, 0, 0);
DateTime fourMonthsAgo = utcDayStart.AddMonths(-4);
// SEE IF THERE ARE ANY RECORDS OLDER THAN FOUR MONTHS
int records = CountAuditLog(fourMonthsAgo);
if (records > 0)
{
// ARCHIVE EVERYTHING OLDER THAN THREE MONTHS
DateTime threeMonthsAgo = utcDayStart.AddMonths(-3);
// SAVE THE LOG
SaveAuditLog(threeMonthsAgo);
// CLEAR THE LOG
TrimAuditLog(threeMonthsAgo);
}
}
|
|
|
|
Rank: Advanced Member
Groups: Admin, Developers, Registered, HelpDesk, Authorized User Joined: 10/5/2018(UTC) Posts: 704
Thanks: 5 times Was thanked: 113 time(s) in 112 post(s)
|
I have created a code improvement issue to look into the future release.
Thanks for pointing this out!
|
|
|
|
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.
Important Information:
The AbleCommerce Forums uses cookies. By continuing to browse this site, you are agreeing to our use of cookies.
More Details
Close