Comments (6)
是因为 model 没有设置 primary key 吗?
from gcache.
是的
from gcache.
能否在没有设置 primary key 时仅给出警告日志,而不要 panic?
from gcache.
不能啊,如果没主键这个缓存就没办法搞了,流程就走不下去了。缓存的关系靠主键的key 来识别的。
不过能接受的是,不设置主键的。直接跳过缓存处理。
from gcache.
是的,正在排查那些没有设置 primary key 的 model,model 太多了,漏设置的不少,一不小心就撞上 panic,服务 crash 了。
from gcache.
设置下主键吧。因该不至于crash。 肯定有recover的。
你需要的话 我就做过个没主键跳过缓存处理。但这样就漏过了。
你看
from gcache.
Related Issues (17)
- 同时并发接口 会500 HOT 7
- 是否可以增加对xormplus或xorm的支持,项目中用到了这个orm库,希望能够支持,谢谢。 HOT 2
- gorm v2 support HOT 5
- 支持应用水平扩展吗? HOT 1
- Preload 不能正常地去存储层获取数据 HOT 9
- Delete got panic: reflect.Value.Addr of unaddressable value HOT 4
- 当我下载包到时候报如下错误,我看了下确实缺少这个定义 HOT 1
- 可以出一个分支支持gorm v2版本吗? HOT 2
- 请教下 PenetrationSafe 防穿透的逻辑 HOT 1
- 可以和go-redis 结合使用吗? HOT 1
- 先更新数据库数据, 还是先更新缓存(或者删除缓存) HOT 1
- 请问有api文档吗? HOT 4
- gorm 这种用法都会报错,应该怎么改? HOT 4
- 是否可以添加preload关联缓存? HOT 2
- 请问根据主键查询为什么不能缓存呢?谢谢。 HOT 6
- 请问如何将全表数据,一次set到redis缓存中 HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gcache.