Commit 202f4043 authored by nanahira's avatar nanahira

Update src/check-cert.ts

parent 45ff0a53
Pipeline #40869 passed with stages
in 52 minutes and 53 seconds
...@@ -14,6 +14,12 @@ class Cert { ...@@ -14,6 +14,12 @@ class Cert {
const now = new Date(); const now = new Date();
const validFrom = new Date(this.cert.validFrom); const validFrom = new Date(this.cert.validFrom);
const validTo = new Date(this.cert.validTo); const validTo = new Date(this.cert.validTo);
if (process.argv[2] === 'renewCert') {
const threshold = new Date(validTo.getTime() - 7 * 24 * 60 * 60 * 1000);
return now > validFrom && now < threshold;
}
return now > validFrom && now < validTo; return now > validFrom && now < validTo;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment