File tree 3 files changed +16
-15
lines changed
3 files changed +16
-15
lines changed Original file line number Diff line number Diff line change 49
49
"debug" : " ^2.6.8" ,
50
50
"get-port" : " ^3.1.0" ,
51
51
"glob" : " ^7.1.2" ,
52
+ "lockfile" : " ^1.0.3" ,
52
53
"mkdirp" : " ^0.5.1" ,
53
54
"mongodb-download" : " ^2.2.3" ,
54
- "proper-lockfile" : " ^2.0.1" ,
55
55
"tmp" : " ^0.0.31" ,
56
56
"uuid" : " ^3.0.1"
57
57
},
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ import { MongoDBDownload } from 'mongodb-download';
4
4
import glob from 'glob' ;
5
5
import os from 'os' ;
6
6
import path from 'path' ;
7
- import lockFile from 'proper- lockfile' ;
7
+ import LockFile from 'lockfile' ;
8
8
import mkdirp from 'mkdirp' ;
9
9
10
10
export type MongoBinaryCache = {
@@ -54,14 +54,18 @@ export default class MongoBinary {
54
54
} ) ;
55
55
} ) ;
56
56
57
+ const lockfile = path . resolve ( downloadDir , `${ version } .lock` ) ;
58
+
57
59
// wait lock
58
60
await new Promise ( ( resolve , reject ) => {
59
- lockFile . lock (
60
- downloadDir ,
61
+ LockFile . lock (
62
+ lockfile ,
61
63
{
62
- stale : 120000 ,
63
- // try to get lock every second, give up after 3 minutes
64
- retries : { retries : 180 , factor : 1 , minTimeout : 1000 } ,
64
+ wait : 120000 ,
65
+ pollPeriod : 100 ,
66
+ stale : 110000 ,
67
+ retries : 3 ,
68
+ retryWait : 100 ,
65
69
} ,
66
70
err => {
67
71
if ( err ) reject ( err ) ;
@@ -86,7 +90,7 @@ export default class MongoBinary {
86
90
}
87
91
88
92
// remove lock
89
- lockFile . unlock ( downloadDir , err => {
93
+ LockFile . unlock ( lockfile , err => {
90
94
debug (
91
95
err
92
96
? `MongoBinary: Error when removing download lock ${ err } `
Original file line number Diff line number Diff line change @@ -2727,6 +2727,10 @@ locate-path@^2.0.0:
2727
2727
p-locate "^2.0.0"
2728
2728
path-exists "^3.0.0"
2729
2729
2730
+ lockfile@^1.0.3 :
2731
+ version "1.0.3"
2732
+ resolved "https://registry.yarnpkg.com/lockfile/-/lockfile-1.0.3.tgz#2638fc39a0331e9cac1a04b71799931c9c50df79"
2733
+
2730
2734
lodash._baseassign@^3.0.0 :
2731
2735
version "3.2.0"
2732
2736
resolved "https://registry.yarnpkg.com/lodash._baseassign/-/lodash._baseassign-3.2.0.tgz#8c38a099500f215ad09e59f1722fd0c52bfe0a4e"
@@ -3365,13 +3369,6 @@ progress@^1.1.8:
3365
3369
version "1.1.8"
3366
3370
resolved "https://registry.yarnpkg.com/progress/-/progress-1.1.8.tgz#e260c78f6161cdd9b0e56cc3e0a85de17c7a57be"
3367
3371
3368
- proper-lockfile@^2.0.1 :
3369
- version "2.0.1"
3370
- resolved "https://registry.yarnpkg.com/proper-lockfile/-/proper-lockfile-2.0.1.tgz#159fb06193d32003f4b3691dd2ec1a634aa80d1d"
3371
- dependencies :
3372
- graceful-fs "^4.1.2"
3373
- retry "^0.10.0"
3374
-
3375
3372
proto-list@~1.2.1 :
3376
3373
version "1.2.4"
3377
3374
resolved "https://registry.yarnpkg.com/proto-list/-/proto-list-1.2.4.tgz#212d5bfe1318306a420f6402b8e26ff39647a849"
You can’t perform that action at this time.
0 commit comments