From 8cb9c51bde8fc8dc9c62568938c56ed9f6eff8fb Mon Sep 17 00:00:00 2001 From: Paul Lecuq Date: Sun, 27 Feb 2022 01:17:21 +0100 Subject: [PATCH] misc changes --- src/models/ip.go | 2 +- src/routers/funcs.go | 8 +------- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/src/models/ip.go b/src/models/ip.go index cb5a0d8..7c1eccb 100644 --- a/src/models/ip.go +++ b/src/models/ip.go @@ -24,7 +24,7 @@ func GetIPs(ctx *context.Context, config *config.Config, limit int) (apimailboxe return } -// GetIPs ... +// GetIPsLast ... func GetIPsLast(ctx *context.Context, config *config.Config, interval string) (apimailboxes []*api.IP, err error) { var ips []IP err = config.Db.Where(fmt.Sprintf("updated >= (now()-'%s'::interval)", interval)).GroupBy("ip").Find(&ips) diff --git a/src/routers/funcs.go b/src/routers/funcs.go index d668d3b..feb2be2 100644 --- a/src/routers/funcs.go +++ b/src/routers/funcs.go @@ -52,14 +52,8 @@ func RegisterRoutes(e *echo.Echo, ctx *context.Context, cfg *config.Config) { ret, err := models.GetIPs(ctx, cfg, limit) return Result(c, err, ret) }) - // retro-compat - e.GET("/ips/lastday", func(c echo.Context) (err error) { - interval := "1 day" - ret, err := models.GetIPsLast(ctx, cfg, interval) - return Result(c, err, ret) - }) e.GET("/ips/last", func(c echo.Context) (err error) { - interval := "10 minutes" + interval := "30 minutes" ret, err := models.GetIPsLast(ctx, cfg, interval) return Result(c, err, ret) })