This commit is contained in:
Vendored
+7
@@ -109,6 +109,13 @@ func (cc CachedConn) QueryCtx(ctx context.Context, v interface{}, key string, qu
|
||||
}
|
||||
return cc.SetCache(key, v)
|
||||
}
|
||||
// Cache data corrupted (e.g. bad JSON), delete key and fall through to DB
|
||||
_ = cc.DelCache(key)
|
||||
err = query(cc.db.WithContext(ctx), v)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return cc.SetCache(key, v)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user