improved logging

This commit is contained in:
2021-10-17 12:29:59 +02:00
parent d39cdf8ed6
commit f9d7224479

View File

@@ -92,11 +92,12 @@ func housekeeping() {
if err != nil {
switch err.(type) {
case utils.AuthcodeUnauthorizedError:
log.Infof("[HK] authCode for player %d is no longer valid", tPlayer.ID)
db.Lock.Lock()
err = tPlayer.Update().ClearAuthCode().ClearSharecodeUpdated().Exec(context.Background())
db.Lock.Unlock()
if err != nil {
log.Warningf("[HK] Unable to clear authcode for player %d: %v", tPlayer.ID, err)
log.Errorf("[HK] Unable to clear authcode for player %d: %v", tPlayer.ID, err)
}
continue
case utils.SharecodeNoMatchError: