From 2bf11fdb75d8154efa285671b163fd3cda09dba5 Mon Sep 17 00:00:00 2001 From: Paul Lecuq Date: Fri, 25 Feb 2022 13:39:19 +0100 Subject: [PATCH] updated misc ipbl functions --- src/models/ip.go | 2 +- src/routers/funcs.go | 6 ------ 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/src/models/ip.go b/src/models/ip.go index ba209f4..6be8be0 100644 --- a/src/models/ip.go +++ b/src/models/ip.go @@ -80,7 +80,7 @@ func InsertIPBulk(cfg *config.Config, ips *[]IP) (numinserts int64, numupdates i for _, ip := range searchips { toupdateips = append(toupdateips, ip.IP) } - cfg.Db.In("ip", toupdateips).Cols("updated").Update(&IP{}) + numupdates, _ = cfg.Db.In("ip", toupdateips).Cols("updated").Update(&IP{}) var toinsertip, _ = differ(*ips, searchips) numinserts, err = cfg.Db.Insert(toinsertip) diff --git a/src/routers/funcs.go b/src/routers/funcs.go index b0eac9d..a140b63 100644 --- a/src/routers/funcs.go +++ b/src/routers/funcs.go @@ -52,12 +52,6 @@ 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" ret, err := models.GetIPsLast(ctx, cfg, interval)