libnpmexec 10.2.2 → 10.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/with-lock.js +7 -7
- package/package.json +3 -3
package/lib/with-lock.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const fs = require('node:fs/promises')
|
|
2
2
|
const { rmdirSync } = require('node:fs')
|
|
3
|
-
const promiseRetry = require('promise-retry')
|
|
3
|
+
const { promiseRetry } = require('@gar/promise-retry')
|
|
4
4
|
const { onExit } = require('signal-exit')
|
|
5
5
|
|
|
6
6
|
// a lockfile implementation inspired by the unmaintained proper-lockfile library
|
|
@@ -67,12 +67,7 @@ async function withLock (lockPath, cb) {
|
|
|
67
67
|
}
|
|
68
68
|
|
|
69
69
|
function acquireLock (lockPath) {
|
|
70
|
-
return promiseRetry({
|
|
71
|
-
minTimeout: 100,
|
|
72
|
-
maxTimeout: 5_000,
|
|
73
|
-
// if another process legitimately holds the lock, wait for it to release; if it dies abnormally and the lock becomes stale, we'll acquire it automatically
|
|
74
|
-
forever: true,
|
|
75
|
-
}, async (retry) => {
|
|
70
|
+
return promiseRetry(async (retry) => {
|
|
76
71
|
try {
|
|
77
72
|
await fs.mkdir(lockPath)
|
|
78
73
|
} catch (err) {
|
|
@@ -107,6 +102,11 @@ function acquireLock (lockPath) {
|
|
|
107
102
|
} catch (err) {
|
|
108
103
|
throw Object.assign(new Error('Lock compromised'), { code: 'ECOMPROMISED' })
|
|
109
104
|
}
|
|
105
|
+
}, {
|
|
106
|
+
minTimeout: 100,
|
|
107
|
+
maxTimeout: 5_000,
|
|
108
|
+
// if another process legitimately holds the lock, wait for it to release; if it dies abnormally and the lock becomes stale, we'll acquire it automatically
|
|
109
|
+
forever: true,
|
|
110
110
|
})
|
|
111
111
|
}
|
|
112
112
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "libnpmexec",
|
|
3
|
-
"version": "10.2.
|
|
3
|
+
"version": "10.2.4",
|
|
4
4
|
"files": [
|
|
5
5
|
"bin/",
|
|
6
6
|
"lib/"
|
|
@@ -60,14 +60,14 @@
|
|
|
60
60
|
"tap": "^16.3.8"
|
|
61
61
|
},
|
|
62
62
|
"dependencies": {
|
|
63
|
-
"@
|
|
63
|
+
"@gar/promise-retry": "^1.0.0",
|
|
64
|
+
"@npmcli/arborist": "^9.4.1",
|
|
64
65
|
"@npmcli/package-json": "^7.0.0",
|
|
65
66
|
"@npmcli/run-script": "^10.0.0",
|
|
66
67
|
"ci-info": "^4.0.0",
|
|
67
68
|
"npm-package-arg": "^13.0.0",
|
|
68
69
|
"pacote": "^21.0.2",
|
|
69
70
|
"proc-log": "^6.0.0",
|
|
70
|
-
"promise-retry": "^2.0.1",
|
|
71
71
|
"read": "^5.0.1",
|
|
72
72
|
"semver": "^7.3.7",
|
|
73
73
|
"signal-exit": "^4.1.0",
|