Skip to content

Commit 3eb9e0c

Browse files
committed
fix: instanceLifecycleConfig command isEmpty
1 parent d27d7cf commit 3eb9e0c

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/resources/fc/impl/replace-function-config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,12 +92,12 @@ export default function (_local: any, _remote: any) {
9292
// 适配钩子函数配置
9393
if (!(_.isEmpty(local?.instanceLifecycleConfig) && _.isEmpty(remote?.instanceLifecycleConfig))) {
9494
const { initializer, preStop } = local.instanceLifecycleConfig || {};
95-
if (initializer?.handler && initializer?.command) {
95+
if (initializer?.handler && initializer?.command && !_.isEmpty(initializer?.command)) {
9696
throw new Error(
9797
'fc3 pre check: command and handler can not be set at the same time in lifecycle Lifecycle.Initializer',
9898
);
9999
}
100-
if (preStop?.handler && preStop?.command) {
100+
if (preStop?.handler && preStop?.command && !_.isEmpty(preStop?.command)) {
101101
throw new Error(
102102
'fc3 pre check: command and handler can not be set at the same time in lifecycle Lifecycle.PreStop',
103103
);

0 commit comments

Comments
 (0)