Skip to content
This repository has been archived by the owner on Mar 23, 2021. It is now read-only.

Commit

Permalink
api_test: Fix bitcoind/parity log wait
Browse files Browse the repository at this point in the history
  • Loading branch information
Franck Royer committed Feb 6, 2020
1 parent eb0dac4 commit 22a3674
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion api_tests/lib/log_reader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,13 @@ export class LogReader {
private tail: Tail;

constructor(logFile: string) {
const options = { fromBeginning: true, follow: true };
// By default tail uses `fs.watch` that watches the inode
// However, it looks like on Mac OS, the inode get changed at some point
// To counter that then we use `fs.watchFile` which is actually considered
// less efficient. Hence only using it on Mac.
const useWatchFile = process.platform === "darwin" ? true : false;

const options = { fromBeginning: true, follow: true, useWatchFile };
this.tail = new Tail(logFile, options);
}

Expand Down

0 comments on commit 22a3674

Please sign in to comment.