Skip to content

Commit

Permalink
fix: fix crash after query of map/path
Browse files Browse the repository at this point in the history
mod: code review
  • Loading branch information
hetao92 committed Nov 14, 2022
1 parent 7093843 commit 5774282
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
10 changes: 5 additions & 5 deletions ccore/nebula/gateway/dao/dao.go
Original file line number Diff line number Diff line change
Expand Up @@ -237,23 +237,23 @@ func getMapInfo(valWarp *wrapper.ValueWrapper, _verticesParsedList *list, _edges
for _, v := range valueMap {
vType := v.GetType()
if vType == "vertex" {
var _props map[string]types.Any
_props := make(map[string]types.Any)
_props, err = getVertexInfo(&v, _props)
if err == nil {
*_verticesParsedList = append(*_verticesParsedList, _props)
} else {
return err
}
} else if vType == "edge" {
var _props map[string]types.Any
_props := make(map[string]types.Any)
_props, err = getEdgeInfo(&v, _props)
if err == nil {
*_edgesParsedList = append(*_edgesParsedList, _props)
} else {
return err
}
} else if vType == "path" {
var _props map[string]types.Any
_props := make(map[string]types.Any)
_props, err = getPathInfo(&v, _props)
if err == nil {
*_pathsParsedList = append(*_pathsParsedList, _props)
Expand Down Expand Up @@ -302,8 +302,8 @@ func Disconnect(nsid string) error {
}

/*
executes the gql based on nsid,
and returns result, the runtime panic error and the result error.
executes the gql based on nsid,
and returns result, the runtime panic error and the result error.
*/
func Execute(nsid string, gql string, paramList types.ParameterList) (ExecuteResult, interface{}, error) {
result := ExecuteResult{
Expand Down
7 changes: 4 additions & 3 deletions service/importer/importer.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ package importer
import (
"errors"
"fmt"
"github.com/vesoft-inc/nebula-importer/pkg/logger"
"path/filepath"
"time"

"github.com/vesoft-inc/nebula-importer/pkg/logger"

"github.com/astaxie/beego"
"github.com/astaxie/beego/logs"
"github.com/vesoft-inc/nebula-importer/pkg/config"
Expand Down Expand Up @@ -135,7 +136,7 @@ func actionQuery(taskID string, result *ActionResult) {
}

/*
`actionQueryAll` will return all tasks with status Aborted or Processing
`actionQueryAll` will return all tasks with status Aborted or Processing
*/
func actionQueryAll(result *ActionResult) {
taskIDs := GetTaskMgr().GetAllTaskIDs()
Expand All @@ -159,7 +160,7 @@ func actionStop(taskID string, result *ActionResult) {
}

/*
`actionStopAll` will stop all tasks with status Processing
`actionStopAll` will stop all tasks with status Processing
*/
func actionStopAll(result *ActionResult) {
taskIDs := GetTaskMgr().GetAllTaskIDs()
Expand Down

0 comments on commit 5774282

Please sign in to comment.