Skip to content

Commit

Permalink
chore: fixes after review
Browse files Browse the repository at this point in the history
  • Loading branch information
nodkz committed Sep 16, 2020
1 parent 87c7b33 commit c338068
Showing 1 changed file with 4 additions and 15 deletions.
19 changes: 4 additions & 15 deletions packages/mongodb-memory-server-core/src/util/MongoBinary.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,15 @@ export default class MongoBinary {
/** Lockfile path */
const lockfile = path.resolve(downloadDir, `${version}.lock`);
// wait to get a lock
// downloading of binaries may be quite long procedure
// that's why we are using so big wait/stale periods
await new Promise((resolve, reject) => {
LockFile.lock(
lockfile,
{
wait: 1000 * 12, // 120 seconds
wait: 1000 * 120, // 120 seconds
pollPeriod: 100,
stale: 1000 * 11, // 110 seconds
stale: 1000 * 110, // 110 seconds
retries: 3,
retryWait: 100,
},
Expand Down Expand Up @@ -196,17 +198,4 @@ export default class MongoBinary {
log(`MongoBinary: Mongod binary path: "${binaryPath}"`);
return binaryPath;
}

/**
* Purpose unkown, not used anywhere
* @param files Array of Strings
*/
static hasValidBinPath(files: string[]): boolean {
if (files.length === 1) {
return true;
} else if (files.length > 1) {
return false;
}
return false;
}
}

0 comments on commit c338068

Please sign in to comment.