Skip to content

Commit

Permalink
Fixed an issue where LIMIT was not working properly
Browse files Browse the repository at this point in the history
  • Loading branch information
Shumpei URABE committed Nov 22, 2018
1 parent f23c7ca commit e0bc981
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions alerts.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -280,7 +280,7 @@ func doAlertsRetrieve(c *cli.Context) error {
}
}

PrettyPrintJSON(alerts.Alerts)
PrettyPrintJSON(alerts.Alerts[:limit])
}
return nil
}
Expand Down Expand Up @@ -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)
Expand All @@ -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 {
Expand Down

0 comments on commit e0bc981

Please sign in to comment.