mirror of
https://github.com/certd/certd.git
synced 2026-08-13 03:35:48 +08:00
perf(cert-plugin): 调整更新天数自动减半逻辑,仅7天ip证书生效,其他情况下不减半
This commit is contained in:
@@ -150,7 +150,7 @@ export abstract class CertApplyBasePlugin extends CertApplyBaseConvertPlugin {
|
|||||||
// 检查有效期
|
// 检查有效期
|
||||||
const leftDays = Math.floor((expires - dayjs().valueOf()) / (1000 * 60 * 60 * 24));
|
const leftDays = Math.floor((expires - dayjs().valueOf()) / (1000 * 60 * 60 * 24));
|
||||||
this.logger.info(`证书有效期剩余天数:${leftDays}`);
|
this.logger.info(`证书有效期剩余天数:${leftDays}`);
|
||||||
if (totalDays < maxDays) {
|
if (totalDays < 10 && totalDays < maxDays) {
|
||||||
this.logger.warn(`当前更新天数为${maxDays},证书总天数${totalDays},总天数小于更新天数(更新天数是指到期前多少天更新证书,您可以在任务配置中调整该值)`);
|
this.logger.warn(`当前更新天数为${maxDays},证书总天数${totalDays},总天数小于更新天数(更新天数是指到期前多少天更新证书,您可以在任务配置中调整该值)`);
|
||||||
maxDays = Math.floor(totalDays / 2);
|
maxDays = Math.floor(totalDays / 2);
|
||||||
if (maxDays < 2) {
|
if (maxDays < 2) {
|
||||||
|
|||||||
Reference in New Issue
Block a user