-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(cmd/influx): fix long startup when running influx help
and other similar commands.
#15777
Conversation
052240e
to
f287c30
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perfect simple solution. Thanks!
platform "github.com/influxdata/influxdb" | ||
_ "github.com/influxdata/influxdb/query/builtin" | ||
|
||
_ "github.com/influxdata/influxdb/query/stdlib" // Import the stdlib | ||
"github.com/spf13/cobra" | ||
"github.com/spf13/viper" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you remove the extra blank lines here and below?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, no problem.
6b0a18e
to
bdd6c6e
Compare
9953f87
to
e5e57a7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes look correct, but please move the FinalizeBuiltIns calls after the flag validation.
cmd/influx/query.go
Outdated
@@ -4,9 +4,12 @@ import ( | |||
"context" | |||
"fmt" | |||
|
|||
"github.com/influxdata/flux" | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove this blank line. Our convention is to group all non-standard-library imports together.
cmd/influx/repl.go
Outdated
@@ -41,6 +42,8 @@ func init() { | |||
} | |||
|
|||
func replF(cmd *cobra.Command, args []string) error { | |||
flux.FinalizeBuiltIns() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should move after the flag validation and before the call to getFluxREPL
-- it would be frustrating to spend the multiple-second wait only to find out that you mistyped an org ID.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah that is true. Changing it now.
cmd/influx/query.go
Outdated
@@ -40,6 +43,8 @@ func init() { | |||
} | |||
|
|||
func fluxQueryF(cmd *cobra.Command, args []string) error { | |||
flux.FinalizeBuiltIns() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This call should also move after flag validation and before getFluxREPL
.
…x help' or related commands
dd0a4f1
to
0664dbc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for making the changes.
Closes #15441
Describe your proposed changes here.