Skip to content

Commit b1072b6

Browse files
committed
remove awkward name httpMonitorScanAndAlertFailuresWithApp()
1 parent 73773fa commit b1072b6

File tree

3 files changed

+8
-13
lines changed

3 files changed

+8
-13
lines changed

cmd/alertmanager/httpmonitors.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,12 @@ func httpMonitorEntry() *cobra.Command {
8181
Short: "Runs all enabled monitors and raises alerts if appropriate",
8282
Args: cobra.NoArgs,
8383
Run: func(cmd *cobra.Command, args []string) {
84-
exitIfError(httpMonitorScanAndAlertFailures(
85-
ossignal.InterruptOrTerminateBackgroundCtx(nil)))
84+
ctx := ossignal.InterruptOrTerminateBackgroundCtx(nil)
85+
86+
app, err := getApp(ctx)
87+
exitIfError(err)
88+
89+
exitIfError(httpMonitorScanAndAlertFailures(ctx, app))
8690
},
8791
})
8892

cmd/alertmanager/httpmonitorscanner.go

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,7 @@ type monitorFailure struct {
1919
monitor amstate.HttpMonitor
2020
}
2121

22-
func httpMonitorScanAndAlertFailures(ctx context.Context) error {
23-
app, err := getApp(ctx)
24-
if err != nil {
25-
return err
26-
}
27-
28-
return httpMonitorScanAndAlertFailuresWithApp(ctx, app)
29-
}
30-
31-
func httpMonitorScanAndAlertFailuresWithApp(ctx context.Context, app *amstate.App) error {
22+
func httpMonitorScanAndAlertFailures(ctx context.Context, app *amstate.App) error {
3223
startOfScan := time.Now()
3324

3425
failures := scanMonitors(

cmd/alertmanager/scheduled.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ func handleCloudwatchScheduledEvent(ctx context.Context, now time.Time) error {
2828
return err
2929
}
3030

31-
if err := httpMonitorScanAndAlertFailuresWithApp(ctx, app); err != nil {
31+
if err := httpMonitorScanAndAlertFailures(ctx, app); err != nil {
3232
return err
3333
}
3434

0 commit comments

Comments
 (0)