From ede713c3df5d2501dbc14e43d6ac7163b311b281 Mon Sep 17 00:00:00 2001 From: Giovanni Harting <539@idlegandalf.com> Date: Tue, 1 Feb 2022 19:55:09 +0100 Subject: [PATCH] do not pass pointer to cache.Cache.Get() --- main.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/main.go b/main.go index 5e1daee..df06b99 100644 --- a/main.go +++ b/main.go @@ -61,8 +61,8 @@ func housekeeping() { } // update players from steam - var lastUpdated *time.Time - err = rdc.Get(context.Background(), utils.CachePrefix+"last_updated_profiles", lastUpdated) + lastUpdated := new(time.Time) + err = rdc.Get(context.Background(), utils.CachePrefix+"last_updated_profiles", &lastUpdated) if err != nil || time.Since(*lastUpdated) >= (time.Hour*24) { tPlayerNeedSteamUpdate, err := db.Player.Query().Where( player.SteamUpdatedLTE(time.Now().UTC().Add(dur * -1)), @@ -72,7 +72,7 @@ func housekeeping() { } if len(tPlayerNeedSteamUpdate) > 0 { - log.Infof("[HK] Updating %d profiles from steam (last update %s)", len(tPlayerNeedSteamUpdate), lastUpdated) + log.Infof("[HK] Updating %d profiles from steam (last update %s)", len(tPlayerNeedSteamUpdate), *lastUpdated) _, err = utils.PlayerFromSteam(tPlayerNeedSteamUpdate, db, conf.Steam.APIKey, rL) if err != nil { log.Warningf("[HK] Unable to update profiles from steam: %v", err)