node-opcua-pki 6.7.1 → 6.7.2
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/dist/bin/pki.mjs +26 -11
- package/dist/bin/pki.mjs.map +1 -1
- package/dist/index.js +26 -11
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +26 -11
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/bin/pki.mjs
CHANGED
|
@@ -1446,22 +1446,31 @@ var init_certificate_manager = __esm({
|
|
|
1446
1446
|
...usePolling ? { interval: pollingInterval } : {},
|
|
1447
1447
|
persistent: false
|
|
1448
1448
|
};
|
|
1449
|
-
const
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1449
|
+
const allCapturedHandles = [];
|
|
1450
|
+
const origWatch = fs4.watch;
|
|
1451
|
+
let watcherReadyCount = 0;
|
|
1452
|
+
const totalWatchers = 5;
|
|
1453
|
+
fs4.watch = ((...args) => {
|
|
1454
|
+
const handle = origWatch.apply(fs4, args);
|
|
1455
|
+
handle.setMaxListeners(handle.getMaxListeners() + 1);
|
|
1456
|
+
handle.on("error", () => {
|
|
1456
1457
|
});
|
|
1458
|
+
allCapturedHandles.push(handle);
|
|
1459
|
+
return handle;
|
|
1460
|
+
});
|
|
1461
|
+
const createUnreffedWatcher = (folder) => {
|
|
1462
|
+
const startIdx = allCapturedHandles.length;
|
|
1457
1463
|
const w = chokidar.watch(folder, chokidarOptions);
|
|
1458
1464
|
const unreffAll = () => {
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1465
|
+
for (let i = startIdx; i < allCapturedHandles.length; i++) {
|
|
1466
|
+
allCapturedHandles[i].unref();
|
|
1467
|
+
}
|
|
1468
|
+
watcherReadyCount++;
|
|
1469
|
+
if (watcherReadyCount >= totalWatchers) {
|
|
1470
|
+
fs4.watch = origWatch;
|
|
1462
1471
|
}
|
|
1463
1472
|
};
|
|
1464
|
-
return { w, capturedHandles, unreffAll };
|
|
1473
|
+
return { w, capturedHandles: allCapturedHandles.slice(startIdx), unreffAll };
|
|
1465
1474
|
};
|
|
1466
1475
|
await Promise.all([
|
|
1467
1476
|
this.#scanCertFolder(this.trustedFolder, this.#thumbs.trusted),
|
|
@@ -1523,6 +1532,9 @@ var init_certificate_manager = __esm({
|
|
|
1523
1532
|
*/
|
|
1524
1533
|
#startCrlWatcher(folder, index, createUnreffedWatcher, store) {
|
|
1525
1534
|
const { w, unreffAll } = createUnreffedWatcher(folder);
|
|
1535
|
+
w.on("error", (err) => {
|
|
1536
|
+
debugLog(`chokidar CRL watcher error on ${folder}:`, err);
|
|
1537
|
+
});
|
|
1526
1538
|
let ready = false;
|
|
1527
1539
|
w.on("unlink", (filename) => {
|
|
1528
1540
|
for (const [key, data] of index.entries()) {
|
|
@@ -1558,6 +1570,9 @@ var init_certificate_manager = __esm({
|
|
|
1558
1570
|
*/
|
|
1559
1571
|
#startWatcher(folder, index, createUnreffedWatcher, store) {
|
|
1560
1572
|
const { w, unreffAll } = createUnreffedWatcher(folder);
|
|
1573
|
+
w.on("error", (err) => {
|
|
1574
|
+
debugLog(`chokidar cert watcher error on ${folder}:`, err);
|
|
1575
|
+
});
|
|
1561
1576
|
let ready = false;
|
|
1562
1577
|
w.on("unlink", (filename) => {
|
|
1563
1578
|
debugLog(chalk3.cyan(`unlink in folder ${folder}`), filename);
|