Private
Public Access
1
0

Fix lint warnings
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2024-03-09 09:03:41 -08:00
parent 3cbef93607
commit 574c7cfbf0

View File

@@ -95,15 +95,14 @@ func (srv *Server) getHistoryParameters(ctx context.Context, c echo.Context) (hi
return p, echo.NewHTTPError(http.StatusNotFound, "monitor not found") return p, echo.NewHTTPError(http.StatusNotFound, "monitor not found")
} }
monitorParam = monitorParam + ".%"
monitor, err := q.GetMonitorByName(ctx, sql.NullString{Valid: true, String: monitorParam})
if err != nil { if err != nil {
monitorParam = monitorParam + ".%" log.Warn("could not find monitor", "name", monitorParam, "err", err)
monitor, err := q.GetMonitorByName(ctx, sql.NullString{Valid: true, String: monitorParam}) return p, echo.NewHTTPError(http.StatusNotFound, "monitor not found")
if err != nil {
log.Warn("could not find monitor", "name", monitorParam, "err", err)
return p, echo.NewHTTPError(http.StatusNotFound, "monitor not found")
}
monitorID = monitor.ID
} }
monitorID = monitor.ID
} }
} }
@@ -133,7 +132,7 @@ func (srv *Server) getHistoryParameters(ctx context.Context, c echo.Context) (hi
return p, nil return p, nil
} }
func (srv *Server) getHistoryMySQL(ctx context.Context, c echo.Context, p historyParameters) (*logscores.LogScoreHistory, error) { func (srv *Server) getHistoryMySQL(ctx context.Context, _ echo.Context, p historyParameters) (*logscores.LogScoreHistory, error) {
ls, err := logscores.GetHistoryMySQL(ctx, srv.db, p.server.ID, uint32(p.monitorID), p.since, p.limit) ls, err := logscores.GetHistoryMySQL(ctx, srv.db, p.server.ID, uint32(p.monitorID), p.since, p.limit)
return ls, err return ls, err
} }