mirror of
https://github.com/certd/certd.git
synced 2026-04-24 20:57:26 +08:00
perf: 优化证书未过期时的任务日志提示
This commit is contained in:
@@ -25,10 +25,10 @@ export default (req: any) => {
|
|||||||
const env = loadEnv(mode, process.cwd());
|
const env = loadEnv(mode, process.cwd());
|
||||||
const devServerFs: any = {};
|
const devServerFs: any = {};
|
||||||
const devAlias: any[] = [];
|
const devAlias: any[] = [];
|
||||||
let base = "./";
|
const base = "./";
|
||||||
if (mode.startsWith("dev")) {
|
// if (mode.startsWith("dev")) {
|
||||||
base = "/certd";
|
// base = "/certd";
|
||||||
}
|
// }
|
||||||
return {
|
return {
|
||||||
base: base,
|
base: base,
|
||||||
plugins: [
|
plugins: [
|
||||||
|
|||||||
@@ -124,6 +124,7 @@ export abstract class CertApplyBasePlugin extends CertApplyBaseConvertPlugin {
|
|||||||
const ret = this.isWillExpire(oldCert, this.renewDays);
|
const ret = this.isWillExpire(oldCert, this.renewDays);
|
||||||
if (!ret.isWillExpire) {
|
if (!ret.isWillExpire) {
|
||||||
this.logger.info(`证书还未过期:过期时间${dayjs(oldCert.expires).format("YYYY-MM-DD HH:mm:ss")},剩余${ret.leftDays}天`);
|
this.logger.info(`证书还未过期:过期时间${dayjs(oldCert.expires).format("YYYY-MM-DD HH:mm:ss")},剩余${ret.leftDays}天`);
|
||||||
|
this.logger.info(`证书将在${ret.nextUpdateDays}天后更新(再次运行本任务时)`);
|
||||||
return oldCert;
|
return oldCert;
|
||||||
}
|
}
|
||||||
this.logger.info("即将过期,开始更新证书");
|
this.logger.info("即将过期,开始更新证书");
|
||||||
@@ -159,6 +160,7 @@ export abstract class CertApplyBasePlugin extends CertApplyBaseConvertPlugin {
|
|||||||
return {
|
return {
|
||||||
isWillExpire: leftDays <= maxDays,
|
isWillExpire: leftDays <= maxDays,
|
||||||
leftDays,
|
leftDays,
|
||||||
|
nextUpdateDays: leftDays - maxDays,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
async sendSuccessNotify() {
|
async sendSuccessNotify() {
|
||||||
|
|||||||
Reference in New Issue
Block a user