Skip to content

Commit

Permalink
修复执行 bulkWrite 导致 panic (#50)
Browse files Browse the repository at this point in the history
* Update server.go

* 修复bulkWrite异常

* 回退格式化的代码

Co-authored-by: 丁少龙 <[email protected]>
  • Loading branch information
Slairmy and 丁少龙 authored Feb 21, 2022
1 parent 099c9d2 commit a8fe6cf
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/mongo_client/mongo_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,11 @@ func (m *MongoProxy) getHandler(i interface{}, f coreExecutor) gotask.Handler {
func (m *MongoProxy) exec(i interface{}, payload []byte, result *[]byte, f coreExecutor) error {
var r interface{}
defer func() {
*result = r.([]byte)
if r == nil {
*result = nil
} else {
*result = r.([]byte)
}
}()
return m.getHandler(i, f)(payload, &r)
}
Expand Down

0 comments on commit a8fe6cf

Please sign in to comment.