-
Notifications
You must be signed in to change notification settings - Fork 9
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
refactor: worker startup process #68
Conversation
Codecov Report
@@ Coverage Diff @@
## master #68 +/- ##
=======================================
Coverage 64.53% 64.53%
=======================================
Files 17 17
Lines 953 953
=======================================
Hits 615 615
Misses 223 223
Partials 115 115
|
) | ||
|
||
// helper function to setup the queue from the CLI arguments. | ||
func setupQueue(c *cli.Context) (queue.Service, error) { | ||
func setupQueue(q *queueSetup) (queue.Service, error) { |
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.
func setupQueue
is unused (from unused
)
} | ||
} | ||
|
||
// helper function to setup the Kafka queue from the CLI arguments. | ||
func setupKafka(c *cli.Context) (queue.Service, error) { | ||
func setupKafka(q *queueSetup) (queue.Service, error) { |
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.
func setupKafka
is unused (from unused
)
) | ||
|
||
// helper function to setup the queue from the CLI arguments. | ||
func setupClient(c *cli.Context) (*vela.Client, error) { | ||
log.Debug("Creating vela client from CLI configuration") | ||
func setupClient(s *Server) (*vela.Client, error) { |
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.
func setupClient
is unused (from unused
)
logrus.Tracef("Creating %s queue client from CLI configuration", constants.DriverKafka) | ||
// return kafka.New(c.String("queue-config"), "vela") | ||
return nil, fmt.Errorf("unsupported queue driver: %s", constants.DriverKafka) | ||
} | ||
|
||
// helper function to setup the Redis queue from the CLI arguments. | ||
func setupRedis(c *cli.Context) (queue.Service, error) { | ||
func setupRedis(q *queueSetup) (queue.Service, error) { |
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.
func setupRedis
is unused (from unused
)
cmd/vela-worker/start.go
Outdated
package main | ||
|
||
import ( | ||
"github.com/sirupsen/logrus" |
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.
File is not goimports
-ed (from goimports
)
"github.com/sirupsen/logrus" |
tomb := new(tomb.Tomb) | ||
|
||
// spawn a tomb goroutine to manage the worker processes | ||
tomb.Go(func() error { |
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.
unnecessary leading newline (from whitespace
)
} | ||
}() | ||
|
||
for { |
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.
S1000: should use for range instead of for { select {} } (from gosimple
)
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.
LGTM 🐬
I fixed some of the linter errors but the linter is still failing for a couple checks 😢
The failed check for the
gosimple
linter (S1000
error) I believe is a bug:dominikh/go-tools#503
The failed check for the
unused
linter is a part of my ongoing refactor work but I'm trying to keep this PR a bit smaller.I vote we ignore the checks 👍