Skip to content

Commit 797d239

Browse files
committed
bring back 'defer' param
1 parent 78799b2 commit 797d239

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/PromisifiedFS.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,14 @@ module.exports = class PromisifiedFS {
8383
this._initPromiseResolve();
8484
this._initPromiseResolve = null;
8585
}
86+
// The next comment starting with the "fs is initially activated when constructed"?
87+
// That can create contention for the mutex if two threads try to init at the same time
88+
// so I've added an option to disable that behavior.
89+
if (!options.defer) {
90+
// The fs is initially activated when constructed (in order to wipe/save the superblock)
91+
// This is not awaited, because that would create a cycle.
92+
this.stat('/')
93+
}
8694
}
8795
async _gracefulShutdown () {
8896
if (this._operations.size > 0) {

0 commit comments

Comments
 (0)