Skip to content

Commit

Permalink
Remove unnecessary created date update (#58)
Browse files Browse the repository at this point in the history
Remove unessesary created date update
  • Loading branch information
bradystroud authored Jul 8, 2024
1 parent 638ff2b commit 49b5833
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions SSW.Rules.AzFuncs/Functions/History/UpdateRuleHistory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ public async Task<HttpResponseData> Run(
var result = await dbContext.RuleHistoryCache.Query(q => q.Where(w => w.MarkdownFilePath == historyEntry.file));
var historyCache = result.FirstOrDefault();

_logger.LogInformation($"filename: {historyEntry.file}");
_logger.LogInformation($"Last updated: {historyEntry.lastUpdated}");
_logger.LogInformation($"Created: {historyEntry.created}");

if (historyCache == null)
{
await dbContext.RuleHistoryCache.Add(new RuleHistoryCache
Expand All @@ -57,9 +61,6 @@ await dbContext.RuleHistoryCache.Add(new RuleHistoryCache
historyCache.ChangedAtDateTime = DateTime.ParseExact(historyEntry.lastUpdated, DateFormat, _provider);
historyCache.ChangedByDisplayName = historyEntry.lastUpdatedBy;
historyCache.ChangedByEmail = historyEntry.lastUpdatedByEmail;
historyCache.CreatedAtDateTime = DateTime.ParseExact(historyEntry.created, DateFormat, _provider);
historyCache.CreatedByDisplayName = historyEntry.createdBy;
historyCache.CreatedByEmail = historyEntry.createdByEmail;
await dbContext.RuleHistoryCache.Update(historyCache);
}
}
Expand Down

0 comments on commit 49b5833

Please sign in to comment.