@cloudbase/manager-node 4.4.2 → 4.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/function/index.js +18 -1
- package/package.json +1 -1
package/lib/function/index.js
CHANGED
|
@@ -458,7 +458,24 @@ class FunctionService {
|
|
|
458
458
|
}));
|
|
459
459
|
params.Layers = transformLayers;
|
|
460
460
|
}
|
|
461
|
-
|
|
461
|
+
try {
|
|
462
|
+
// 如果函数配置中包含触发器,则更新触发器
|
|
463
|
+
if (func.triggers && func.triggers.length > 0) {
|
|
464
|
+
try {
|
|
465
|
+
await this.createFunctionTriggers(func.name, func.triggers);
|
|
466
|
+
}
|
|
467
|
+
catch (triggerError) {
|
|
468
|
+
// 如果触发器创建失败,记录警告
|
|
469
|
+
console.warn(`[${func.name}] 触发器更新失败:${triggerError.message}`);
|
|
470
|
+
}
|
|
471
|
+
}
|
|
472
|
+
return this.scfService.request('UpdateFunctionConfiguration', params);
|
|
473
|
+
}
|
|
474
|
+
catch (e) {
|
|
475
|
+
throw new error_1.CloudBaseError(`[${func.name}] 更新函数配置失败:${e.message}`, {
|
|
476
|
+
code: e.code
|
|
477
|
+
});
|
|
478
|
+
}
|
|
462
479
|
}
|
|
463
480
|
/**
|
|
464
481
|
*
|