Skip to content

Commit 761d05a

Browse files
author
Marcin Mazurek
committed
[DDW-1088] Fix no progress shown on splash screen on Windows
1 parent b467468 commit 761d05a

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

source/main/utils/handleCheckBlockReplayProgress.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { getBlockSyncProgressChannel } from '../ipc/get-block-sync-progress';
77
import type { GetBlockSyncProgressType } from '../../common/ipc/api';
88
import { BlockSyncType } from '../../common/types/cardano-node.types';
99
import { isItFreshLog } from './blockSyncProgressHelpers';
10+
import { environment } from '../environment';
1011

1112
const blockKeyword = 'Replayed block';
1213
const validatingChunkKeyword = 'Validating chunk';
@@ -52,7 +53,12 @@ export const handleCheckBlockReplayProgress = (
5253
const filePath = path.join(logFilePath, filename);
5354
if (!fs.existsSync(filePath)) return;
5455

55-
const tail = new Tail(filePath);
56+
const tail = new Tail(filePath, {
57+
// using fs.watchFile instead of fs.watch on Windows because of Node API inconsistency:
58+
// https://nodejs.org/dist/latest-v14.x/docs/api/fs.html#fs_caveats
59+
// https://github.com/lucagrulla/node-tail/issues/137
60+
useWatchFile: environment.isWindows,
61+
});
5662

5763
tail.on('line', (line) => {
5864
if (

0 commit comments

Comments
 (0)