Skip to content

Commit

Permalink
fix: delay flux.FinalizeBuiltins as late as possible
Browse files Browse the repository at this point in the history
  • Loading branch information
Faith Chikwekwe authored and Faith Chikwekwe committed Nov 6, 2019
1 parent e5e57a7 commit dd0a4f1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
5 changes: 2 additions & 3 deletions cmd/influx/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"fmt"

"github.com/influxdata/flux"

"github.com/influxdata/flux/repl"
_ "github.com/influxdata/flux/stdlib"
platform "github.com/influxdata/influxdb"
Expand Down Expand Up @@ -43,8 +42,6 @@ func init() {
}

func fluxQueryF(cmd *cobra.Command, args []string) error {
flux.FinalizeBuiltIns()

if flags.local {
return fmt.Errorf("local flag not supported for query command")
}
Expand Down Expand Up @@ -81,6 +78,8 @@ func fluxQueryF(cmd *cobra.Command, args []string) error {
orgID = o.ID
}

flux.FinalizeBuiltIns()

r, err := getFluxREPL(flags.host, flags.token, orgID)
if err != nil {
return fmt.Errorf("failed to get the flux REPL: %v", err)
Expand Down
4 changes: 2 additions & 2 deletions cmd/influx/repl.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@ func init() {
}

func replF(cmd *cobra.Command, args []string) error {
flux.FinalizeBuiltIns()

if flags.local {
return fmt.Errorf("local flag not supported for repl command")
}
Expand Down Expand Up @@ -73,6 +71,8 @@ func replF(cmd *cobra.Command, args []string) error {
}
}

flux.FinalizeBuiltIns()

r, err := getFluxREPL(flags.host, flags.token, orgID)
if err != nil {
return err
Expand Down

0 comments on commit dd0a4f1

Please sign in to comment.