address #86 should be possible to wait for cert renewal to complete

This commit is contained in:
AJ ONeal 2017-05-05 17:17:28 -06:00
부모 f9a937c5f8
커밋 5173962517
1개의 변경된 파일7개의 추가작업 그리고 1개의 파일을 삭제

파일 보기

@ -382,6 +382,7 @@ module.exports.create = function (le) {
// Certificates
, getAsync: function (args) {
var copy = utils.merge(args, le);
var renewing;
args = utils.tplCopy(copy);
return core.certificates.checkAsync(args).then(function (certs) {
@ -391,9 +392,14 @@ module.exports.create = function (le) {
}
if (core.certificates._isRenewable(args, certs)) {
certs._renewing = core.certificates.renewAsync(args, certs);
// it's time to renew the available cert
renewing = core.certificates.renewAsync(args, certs);
if (args.waitForRenewal) {
return renewing;
}
}
// return existing unexpired (although potentially stale) certificates when available
return certs;
}).then(function (results) {
// returns pems