do not pass pointer to cache.Cache.Get()
This commit is contained in:
6
main.go
6
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)
|
||||
|
Reference in New Issue
Block a user