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)