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
|
// update players from steam
|
||||||
var lastUpdated *time.Time
|
lastUpdated := new(time.Time)
|
||||||
err = rdc.Get(context.Background(), utils.CachePrefix+"last_updated_profiles", lastUpdated)
|
err = rdc.Get(context.Background(), utils.CachePrefix+"last_updated_profiles", &lastUpdated)
|
||||||
if err != nil || time.Since(*lastUpdated) >= (time.Hour*24) {
|
if err != nil || time.Since(*lastUpdated) >= (time.Hour*24) {
|
||||||
tPlayerNeedSteamUpdate, err := db.Player.Query().Where(
|
tPlayerNeedSteamUpdate, err := db.Player.Query().Where(
|
||||||
player.SteamUpdatedLTE(time.Now().UTC().Add(dur * -1)),
|
player.SteamUpdatedLTE(time.Now().UTC().Add(dur * -1)),
|
||||||
@@ -72,7 +72,7 @@ func housekeeping() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if len(tPlayerNeedSteamUpdate) > 0 {
|
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)
|
_, err = utils.PlayerFromSteam(tPlayerNeedSteamUpdate, db, conf.Steam.APIKey, rL)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Warningf("[HK] Unable to update profiles from steam: %v", err)
|
log.Warningf("[HK] Unable to update profiles from steam: %v", err)
|
||||||
|
Reference in New Issue
Block a user