mirror of
https://github.com/certd/certd.git
synced 2026-04-24 20:57:26 +08:00
perf: 优化阿里云clb 过期证书清理报错的问题
This commit is contained in:
@@ -155,10 +155,14 @@ export class AliyunDeployCertToALB extends AbstractTaskPlugin {
|
|||||||
const client = await this.getLBClient(access, this.regionId);
|
const client = await this.getLBClient(access, this.regionId);
|
||||||
await this.deployDefaultCert(certId, client);
|
await this.deployDefaultCert(certId, client);
|
||||||
}
|
}
|
||||||
|
this.logger.info(`准备开始清理过期证书`);
|
||||||
await this.ctx.utils.sleep(10000)
|
await this.ctx.utils.sleep(20000)
|
||||||
for (const listener of this.listeners) {
|
for (const listener of this.listeners) {
|
||||||
await this.clearInvalidCert(albClientV2, listener);
|
try{
|
||||||
|
await this.clearInvalidCert(albClientV2, listener);
|
||||||
|
}catch(e){
|
||||||
|
this.logger.error(`清理监听器${listener}的过期证书失败`, e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -259,7 +263,7 @@ export class AliyunDeployCertToALB extends AbstractTaskPlugin {
|
|||||||
this.logger.info(`监听器${listener}没有过期的证书`);
|
this.logger.info(`监听器${listener}没有过期的证书`);
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
this.logger.info(`开始解绑过期的证书:${invalidCertIds}`);
|
this.logger.info(`开始解绑过期的证书:${invalidCertIds},listener:${listener}`);
|
||||||
await client.doRequest({
|
await client.doRequest({
|
||||||
// 接口名称
|
// 接口名称
|
||||||
action: "DissociateAdditionalCertificatesFromListener",
|
action: "DissociateAdditionalCertificatesFromListener",
|
||||||
|
|||||||
@@ -152,9 +152,14 @@ export class AliyunDeployCertToNLB extends AbstractTaskPlugin {
|
|||||||
await this.deployDefaultCert(certId, client);
|
await this.deployDefaultCert(certId, client);
|
||||||
}
|
}
|
||||||
|
|
||||||
await this.ctx.utils.sleep(10000)
|
this.logger.info(`准备开始清理过期证书`);
|
||||||
|
await this.ctx.utils.sleep(20000)
|
||||||
for (const listener of this.listeners) {
|
for (const listener of this.listeners) {
|
||||||
await this.clearInvalidCert(nlbClientV2, listener);
|
try{
|
||||||
|
await this.clearInvalidCert(nlbClientV2, listener);
|
||||||
|
}catch(e){
|
||||||
|
this.logger.error(`清理监听器${listener}的过期证书失败`, e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.logger.info('执行完成');
|
this.logger.info('执行完成');
|
||||||
@@ -255,7 +260,7 @@ export class AliyunDeployCertToNLB extends AbstractTaskPlugin {
|
|||||||
this.logger.info(`监听器${listener}没有过期的证书`);
|
this.logger.info(`监听器${listener}没有过期的证书`);
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
this.logger.info(`开始解绑过期的证书:${invalidCertIds}`);
|
this.logger.info(`开始解绑过期的证书:${invalidCertIds},listener:${listener}`);
|
||||||
|
|
||||||
const ids:any = {}
|
const ids:any = {}
|
||||||
let i = 0
|
let i = 0
|
||||||
|
|||||||
Reference in New Issue
Block a user