From e0bc981615a27200db532f4fe1080ab59f263e72 Mon Sep 17 00:00:00 2001 From: Shumpei URABE Date: Thu, 22 Nov 2018 16:19:30 +0900 Subject: [PATCH] Fixed an issue where LIMIT was not working properly --- alerts.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/alerts.go b/alerts.go index fe2aa046..4a3f4e3a 100644 --- a/alerts.go +++ b/alerts.go @@ -263,7 +263,7 @@ func doAlertsRetrieve(c *cli.Context) error { } } - PrettyPrintJSON(alerts.Alerts) + PrettyPrintJSON(alerts.Alerts[:limit]) } else { alerts, err := client.FindAlerts() logger.DieIf(err) @@ -280,7 +280,7 @@ func doAlertsRetrieve(c *cli.Context) error { } } - PrettyPrintJSON(alerts.Alerts) + PrettyPrintJSON(alerts.Alerts[:limit]) } return nil } @@ -312,7 +312,7 @@ func doAlertsList(c *cli.Context) error { } } } - alert = alerts.Alerts + alert = alerts.Alerts[:limit] } else { alerts, err := client.FindAlerts() logger.DieIf(err) @@ -328,7 +328,7 @@ func doAlertsList(c *cli.Context) error { time.Sleep(1 * time.Second) } } - alert = alerts.Alerts + alert = alerts.Alerts[:limit] } joinedAlerts := joinMonitorsAndHosts(client, alert) for _, joinAlert := range joinedAlerts {