Skip to content

Commit f7401b7

Browse files
authored
refactor: read config disable_integration_init to decide skip init integration (#2492)
1 parent ef04300 commit f7401b7

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

center/integration/init.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,14 @@ func Init(ctx *ctx.Context, builtinIntegrationsDir string) {
2222
return
2323
}
2424

25+
if res, err := models.ConfigsSelectByCkey(ctx, "disable_integration_init"); err != nil {
26+
logger.Error("fail to get value 'disable_integration_init' from configs", err)
27+
return
28+
} else if len(res) != 0 {
29+
logger.Info("disable_integration_init is set, skip integration init")
30+
return
31+
}
32+
2533
fp := builtinIntegrationsDir
2634
if fp == "" {
2735
fp = path.Join(runner.Cwd, "integrations")

0 commit comments

Comments
 (0)