zeromicro / go-zero

A cloud-native Go microservices framework with cli tool for productivity.

Home Page:https://go-zero.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

goctl 生成带缓存的model时候 ,默认 insert方法,需要清除id key的缓存

Mikaelemmmm opened this issue · comments

比如 我现在findOne时候 ,db没有这条数据,缓存有一条* , 然后这时候insert ,缓存中还是* ,用户查询数据会提示不存在,当*失效之后才会查到数据 , 所以insert之后保险起见最好 清除一下带id 的key的缓存

比如 我现在findOne时候 ,db没有这条数据,缓存有一条* , 然后这时候insert ,缓存中还是* ,用户查询数据会提示不存在,当*失效之后才会查到数据 , 所以insert之后保险起见最好 清除一下带id 的key的缓存

see pr #1151 (comment)