-
Notifications
You must be signed in to change notification settings - Fork 51
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
panic: reflect: call of reflect.Value.FieldByName on ptr Value #18
Comments
是因为 model 没有设置 primary key 吗? |
是的 |
能否在没有设置 primary key 时仅给出警告日志,而不要 panic? |
不能啊,如果没主键这个缓存就没办法搞了,流程就走不下去了。缓存的关系靠主键的key 来识别的。 |
是的,正在排查那些没有设置 primary key 的 model,model 太多了,漏设置的不少,一不小心就撞上 panic,服务 crash 了。 |
设置下主键吧。因该不至于crash。 肯定有recover的。 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
类似的错误很容易发生,能看出来是什么原因吗:
The text was updated successfully, but these errors were encountered: