This is an automated email from the ASF dual-hosted git repository.
likyh pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git
The following commit(s) were added to refs/heads/main by this push:
new dce79d304 fix: dbt log show failure, but it succeeded (#3969)
dce79d304 is described below
commit dce79d304953020556806cf752830c965770a6d3
Author: abeizn <[email protected]>
AuthorDate: Mon Dec 19 17:38:02 2022 +0800
fix: dbt log show failure, but it succeeded (#3969)
* fix: dbt log show failure, but it succeeded
* fix: dbt log show failure, but it succeeded and add note
---
plugins/dbt/tasks/convertor.go | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/plugins/dbt/tasks/convertor.go b/plugins/dbt/tasks/convertor.go
index 04795aae8..6a1abecb3 100644
--- a/plugins/dbt/tasks/convertor.go
+++ b/plugins/dbt/tasks/convertor.go
@@ -184,6 +184,13 @@ func DbtConverter(taskCtx core.SubTaskContext)
errors.Error {
if err != nil {
return err
}
+ // ProcessState contains information about an exited process, available
after a call to Wait.
+ defer func() {
+ if !cmd.ProcessState.Success() {
+ log.Error(nil, "dbt run task error, please check!!!")
+ }
+ }()
+
// prevent zombie process
defer cmd.Wait() //nolint
@@ -203,10 +210,6 @@ func DbtConverter(taskCtx core.SubTaskContext)
errors.Error {
return err
}
- if !cmd.ProcessState.Success() {
- log.Error(nil, "dbt run task error, please check!!!")
- }
-
return nil
}