fix(core): update
This commit is contained in:
parent
595d4d8894
commit
7ec04d6d3d
@ -41,7 +41,7 @@ export class Cert extends plugins.smartdata.SmartDataDbDoc<Cert> implements plug
|
|||||||
plugins.smarttime.getMilliSecondsFromUnits({
|
plugins.smarttime.getMilliSecondsFromUnits({
|
||||||
days: 10
|
days: 10
|
||||||
});
|
});
|
||||||
return this.validUntil >= shouldBeValidAtLeastUntil;
|
return !(this.validUntil >= shouldBeValidAtLeastUntil);
|
||||||
}
|
}
|
||||||
|
|
||||||
public update(certDataArg: plugins.tsclass.network.ICert) {
|
public update(certDataArg: plugins.tsclass.network.ICert) {
|
||||||
|
@ -114,14 +114,17 @@ export class SmartAcme {
|
|||||||
const certDomainName = this.certmatcher.getCertificateDomainNameByDomainName(domainArg);
|
const certDomainName = this.certmatcher.getCertificateDomainNameByDomainName(domainArg);
|
||||||
const retrievedCertificate = await this.certmanager.retrieveCertificate(certDomainName);
|
const retrievedCertificate = await this.certmanager.retrieveCertificate(certDomainName);
|
||||||
|
|
||||||
|
const shouldberenewed = retrievedCertificate.shouldBeRenewed();
|
||||||
|
const isStillValid = retrievedCertificate.isStillValid();
|
||||||
|
|
||||||
if (!retrievedCertificate && await this.certmanager.interestMap.checkInterest(certDomainName)) {
|
if (!retrievedCertificate && await this.certmanager.interestMap.checkInterest(certDomainName)) {
|
||||||
const existingCertificateInterest = this.certmanager.interestMap.findInterest(certDomainName);
|
const existingCertificateInterest = this.certmanager.interestMap.findInterest(certDomainName);
|
||||||
const certificate = existingCertificateInterest.interestFullfilled;
|
const certificate = existingCertificateInterest.interestFullfilled;
|
||||||
return certificate;
|
return certificate;
|
||||||
} else if (retrievedCertificate && !retrievedCertificate.shouldBeRenewed()) {
|
} else if (retrievedCertificate && !retrievedCertificate.shouldBeRenewed()) {
|
||||||
return retrievedCertificate;
|
return retrievedCertificate;
|
||||||
} else if (retrievedCertificate && retrievedCertificate.shouldBeRenewed) {
|
} else if (retrievedCertificate && retrievedCertificate.shouldBeRenewed()) {
|
||||||
await retrievedCertificate.delete();
|
// await retrievedCertificate.delete();
|
||||||
}
|
}
|
||||||
|
|
||||||
// lets make sure others get the same interest
|
// lets make sure others get the same interest
|
||||||
|
Loading…
Reference in New Issue
Block a user