From 3cca9c7fa73a4f9c4271d21ca5b596d8a1515931 Mon Sep 17 00:00:00 2001 From: bakhirev Date: Wed, 14 Aug 2024 01:06:00 +0300 Subject: [PATCH] update --- src/ts/helpers/Parser/getCommitInfo.ts | 5 +++++ src/ts/helpers/Parser/index.ts | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/ts/helpers/Parser/getCommitInfo.ts b/src/ts/helpers/Parser/getCommitInfo.ts index 29c9042..07cba9e 100644 --- a/src/ts/helpers/Parser/getCommitInfo.ts +++ b/src/ts/helpers/Parser/getCommitInfo.ts @@ -13,6 +13,11 @@ let prevDate = new Date(); let refTimestampTime = {}; +export function clearCache() { + prevDate = new Date(); + refTimestampTime = {}; +} + export default function getCommitInfo( logString: string, refEmailAuthor: IHashMap, diff --git a/src/ts/helpers/Parser/index.ts b/src/ts/helpers/Parser/index.ts index e851b0d..ed0f3bb 100644 --- a/src/ts/helpers/Parser/index.ts +++ b/src/ts/helpers/Parser/index.ts @@ -3,7 +3,7 @@ import ICommit, { IFileChange, ISystemCommit } from 'ts/interfaces/Commit'; import IHashMap from 'ts/interfaces/HashMap'; import { ONE_DAY, ONE_WEEK } from 'ts/helpers/formatter'; -import getCommitInfo from './getCommitInfo'; +import getCommitInfo, { clearCache } from './getCommitInfo'; import { getInfoFromPath, getNumStatInfo, getRawInfo } from './getFileChanges'; function updateLineTotal(commit: any, line: any) { @@ -21,6 +21,7 @@ export default function Parser(report: string[]) { let fileChanges: IFileChange | null = null; let firstMonday = 0; + clearCache(); for (let i = 0, l = report.length; i < l; i += 1) { const message = report[i];