Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

before_query 查到缓存 key 存在,可能会在 after_query 前过期 #14

Closed
bowenpz opened this issue Nov 8, 2022 · 2 comments
Closed

Comments

@bowenpz
Copy link

bowenpz commented Nov 8, 2022

cacheValue, err := cache.GetSearchCache(ctx, tableName, sql, vars...)

缓存有过期时间,如果碰巧在 after_query 前过期,那就会查不到

@bowenpz
Copy link
Author

bowenpz commented Nov 8, 2022

提两个个人建议哈

  • before_query 直接查缓存,放到上下文里传下去
  • before_query 做一下防缓存击穿,缓存过期的时候 db 扛不住的

@Pacific73
Copy link
Owner

谢谢你的建议,这些建议均已实现,请使用最新版

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants