From dba9f89603677ae1ad427730cb2aaecac925f102 Mon Sep 17 00:00:00 2001 From: Jingliu Xiong Date: Thu, 31 Mar 2022 16:00:50 +0800 Subject: [PATCH] adapt log importer (#160) --- server/go.mod | 2 +- server/go.sum | 4 ++-- server/pkg/webserver/service/importer/importer.go | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/server/go.mod b/server/go.mod index 213c86a9..861b36aa 100644 --- a/server/go.mod +++ b/server/go.mod @@ -9,7 +9,7 @@ require ( github.com/mattn/go-sqlite3 v2.0.3+incompatible github.com/saintfish/chardet v0.0.0-20120816061221-3af4cd4741ca github.com/vesoft-inc/nebula-http-gateway/ccore v0.0.0-20220329020324-f599adfab640 - github.com/vesoft-inc/nebula-importer v1.0.1-0.20220314055243-ece1a79d37e5 + github.com/vesoft-inc/nebula-importer v1.0.1-0.20220331072417-e7281ccc8a1a go.uber.org/zap v1.17.0 gopkg.in/yaml.v2 v2.4.0 gorm.io/driver/sqlite v1.2.6 diff --git a/server/go.sum b/server/go.sum index 372ff285..8456cd00 100644 --- a/server/go.sum +++ b/server/go.sum @@ -255,8 +255,8 @@ github.com/vesoft-inc/nebula-go/v3 v3.0.0-20220214062853-d0c59964d0af h1:5z3eC9o github.com/vesoft-inc/nebula-go/v3 v3.0.0-20220214062853-d0c59964d0af/go.mod h1:+sXv05jYQBARdTbTcIEsWVXCnF/6ttOlDK35xQ6m54s= github.com/vesoft-inc/nebula-http-gateway/ccore v0.0.0-20220329020324-f599adfab640 h1:k0lt8tqjIWLpLhx39nNJzxq9G4/c4Szd1F0LZG5txfI= github.com/vesoft-inc/nebula-http-gateway/ccore v0.0.0-20220329020324-f599adfab640/go.mod h1:sFEvE+cY4TgwqWx6H6msOqAUzRhsEHHKaaMgIZENHuQ= -github.com/vesoft-inc/nebula-importer v1.0.1-0.20220314055243-ece1a79d37e5 h1:YghW/f27/NEpP8h3yAn2p7WCZYUIx3rc+pdS3v9QmRc= -github.com/vesoft-inc/nebula-importer v1.0.1-0.20220314055243-ece1a79d37e5/go.mod h1:Hgn05JWXQcxyoJAjJVN34PnUndY+JcNKzpb0DoyFrsM= +github.com/vesoft-inc/nebula-importer v1.0.1-0.20220331072417-e7281ccc8a1a h1:h11b2euzCDnX9cKO6xLs0iqziAT8txCDjHunDUndd+k= +github.com/vesoft-inc/nebula-importer v1.0.1-0.20220331072417-e7281ccc8a1a/go.mod h1:Hgn05JWXQcxyoJAjJVN34PnUndY+JcNKzpb0DoyFrsM= github.com/vmihailenco/msgpack/v5 v5.0.0/go.mod h1:HVxBVPUK/+fZMonk4bi1islLa8V3cfnBug0+4dykPzo= github.com/vmihailenco/msgpack/v5 v5.3.4 h1:qMKAwOV+meBw2Y8k9cVwAy7qErtYCwBzZ2ellBfvnqc= github.com/vmihailenco/msgpack/v5 v5.3.4/go.mod h1:7xyJ9e+0+9SaZT0Wt1RGleJXzli6Q/V5KbhBonMG9jc= diff --git a/server/pkg/webserver/service/importer/importer.go b/server/pkg/webserver/service/importer/importer.go index eb6e66b0..f1c1dc30 100644 --- a/server/pkg/webserver/service/importer/importer.go +++ b/server/pkg/webserver/service/importer/importer.go @@ -11,6 +11,7 @@ import ( importconfig "github.com/vesoft-inc/nebula-importer/pkg/config" importerErrors "github.com/vesoft-inc/nebula-importer/pkg/errors" + "github.com/vesoft-inc/nebula-importer/pkg/logger" "github.com/vesoft-inc/nebula-studio/server/pkg/config" "github.com/vesoft-inc/nebula-studio/server/pkg/utils" @@ -95,10 +96,9 @@ func Import(taskID string, configPath string, configBody *importconfig.YAMLConfi zap.L().Debug(fmt.Sprintf("Start a import task: `%s`", taskID)) var conf *importconfig.YAMLConfig + runnerLogger := logger.NewRunnerLogger("") if configPath != "" { - conf, err = importconfig.Parse( - configPath, - ) + conf, err = importconfig.Parse(configPath, runnerLogger) if err != nil { return err.(importerErrors.ImporterError) @@ -106,7 +106,7 @@ func Import(taskID string, configPath string, configBody *importconfig.YAMLConfi } else { conf = configBody } - if err := conf.ValidateAndReset(""); err != nil { + if err := conf.ValidateAndReset("", runnerLogger); err != nil { return err }