roster-server 2.3.14 → 2.3.16
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/package.json
CHANGED
|
@@ -384,13 +384,34 @@ G.create = function(gconf) {
|
|
|
384
384
|
return dir.promise;
|
|
385
385
|
}
|
|
386
386
|
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
387
|
+
var maxRetries = 3;
|
|
388
|
+
var lastErr;
|
|
389
|
+
for (var attempt = 1; attempt <= maxRetries; attempt++) {
|
|
390
|
+
try {
|
|
391
|
+
await acme.init(dirUrl);
|
|
392
|
+
lastErr = null;
|
|
393
|
+
break;
|
|
394
|
+
} catch (err) {
|
|
395
|
+
lastErr = err;
|
|
396
|
+
log.error(
|
|
397
|
+
"ACME init attempt " +
|
|
398
|
+
attempt +
|
|
399
|
+
"/" +
|
|
400
|
+
maxRetries +
|
|
401
|
+
" failed (directory may be down or directoryUrl wrong):",
|
|
402
|
+
err.message
|
|
403
|
+
);
|
|
404
|
+
if (attempt < maxRetries) {
|
|
405
|
+
await new Promise(function(resolve) {
|
|
406
|
+
setTimeout(resolve, 1000 * attempt);
|
|
407
|
+
});
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
if (lastErr) {
|
|
412
|
+
delete caches[dirUrl];
|
|
413
|
+
throw lastErr;
|
|
414
|
+
}
|
|
394
415
|
|
|
395
416
|
caches[dirUrl] = {
|
|
396
417
|
promise: Promise.resolve(acme),
|