perf: 优化scp上传

pull/361/head
xiaojunnuo 2025-03-26 21:48:51 +08:00
parent 92bb12e2e3
commit e51123a951
2 changed files with 8 additions and 3 deletions

View File

@ -304,6 +304,7 @@ export class SshClient {
//scp
for (const transport of transports) {
await this.scpUpload({ conn, ...transport, opts });
await new Promise(resolve => setTimeout(resolve, 1000));
}
}
@ -333,9 +334,13 @@ export class SshClient {
// 通过管道传输文件
fs.createReadStream(localPath)
.on("error", e => {
this.logger.info("read stream error", e);
reject(e);
})
.pipe(stream)
.on("finish", () => {
this.logger.info(`上传文件成功:${localPath} => ${remotePath}`);
.on("finish", async () => {
this.logger.info(`上传完成${localPath} => ${remotePath}`);
resolve(true);
})
.on("error", reject);

View File

@ -11,7 +11,7 @@ import {optionsUtils} from "@certd/basic/dist/utils/util.options.js";
title: '又拍云-部署证书到CDN',
icon: 'svg:icon-upyun',
//插件分组
group: pluginGroups.other.key,
group: pluginGroups.cdn.key,
needPlus: true,
default: {
//默认值配置照抄即可