Skip to content

Commit 9c86f80

Browse files
author
Lucas Araujo
committed
[DDW-812] Review: logDate fallback; Refactor logic
1 parent 6ec57d8 commit 9c86f80

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

source/main/utils/blockSyncProgressHelpers.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@ import moment, { Moment } from 'moment';
33
export function isItFreshLog(applicationStartDate: Moment, line: string) {
44
const [, logDate] =
55
line.match(/\[(\d{4}-\d{2}-\d{2}\s\d{2}:\d{2}:\d{2}\.\d+) UTC]/) || [];
6-
return applicationStartDate.isBefore(moment.utc(logDate));
6+
7+
return !!logDate && applicationStartDate.isBefore(moment.utc(logDate));
78
}

source/main/utils/handleCheckBlockReplayProgress.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,8 @@ export const handleCheckBlockReplayProgress = (
5656

5757
tail.on('line', (line) => {
5858
if (
59-
!(
60-
isItFreshLog(applicationStartDate, line) &&
61-
containProgressKeywords(line)
62-
)
59+
!isItFreshLog(applicationStartDate, line) ||
60+
!containProgressKeywords(line)
6361
) {
6462
return;
6563
}

0 commit comments

Comments
 (0)