Skip to content

Commit 1984ea0

Browse files
committed
feat(checks): skip disabled checks during app startup
1 parent 82bf3bb commit 1984ea0

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

internal/app/app.go

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@ func (a *App) Run(ctx context.Context) error {
4343
g, ctx := errgroup.WithContext(ctx)
4444

4545
for i := range a.cfg.HttpChecks {
46+
if !a.cfg.HttpChecks[i].Enabled {
47+
continue
48+
}
49+
4650
executor := internal.NewCheckExecutor(
4751
a.checkHandlerSvc,
4852
a.cfg.HttpChecks[i].CheckFields,
@@ -55,6 +59,10 @@ func (a *App) Run(ctx context.Context) error {
5559
}
5660

5761
for i := range a.cfg.TCPChecks {
62+
if !a.cfg.TCPChecks[i].Enabled {
63+
continue
64+
}
65+
5866
executor := internal.NewCheckExecutor(
5967
a.checkHandlerSvc,
6068
a.cfg.TCPChecks[i].CheckFields,
@@ -67,6 +75,10 @@ func (a *App) Run(ctx context.Context) error {
6775
}
6876

6977
for i := range a.cfg.GRPCChecks {
78+
if !a.cfg.GRPCChecks[i].Enabled {
79+
continue
80+
}
81+
7082
executor := internal.NewCheckExecutor(
7183
a.checkHandlerSvc,
7284
a.cfg.GRPCChecks[i].CheckFields,
@@ -79,6 +91,10 @@ func (a *App) Run(ctx context.Context) error {
7991
}
8092

8193
for i := range a.cfg.DNSChecks {
94+
if !a.cfg.DNSChecks[i].Enabled {
95+
continue
96+
}
97+
8298
executor := internal.NewCheckExecutor(
8399
a.checkHandlerSvc,
84100
a.cfg.DNSChecks[i].CheckFields,
@@ -91,6 +107,10 @@ func (a *App) Run(ctx context.Context) error {
91107
}
92108

93109
for i := range a.cfg.TLSChecks {
110+
if !a.cfg.TLSChecks[i].Enabled {
111+
continue
112+
}
113+
94114
executor := internal.NewCheckExecutor(
95115
a.checkHandlerSvc,
96116
a.cfg.TLSChecks[i].CheckFields,

0 commit comments

Comments
 (0)