-
Notifications
You must be signed in to change notification settings - Fork 16
Updates #28
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
base: master
Are you sure you want to change the base?
Updates #28
Changes from 6 commits
23fbc50
6439512
fc360f5
100cdb2
af360ed
699befe
b5fc070
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,7 +13,6 @@ import ( | |
|
|
||
| "github.com/go-redis/redis" | ||
| "github.com/gobridge/gopherbot/cache" | ||
| "github.com/gobridge/gopherbot/cmd/consumer/playground" | ||
| "github.com/gobridge/gopherbot/config" | ||
| "github.com/gobridge/gopherbot/glossary" | ||
| "github.com/gobridge/gopherbot/handler" | ||
|
|
@@ -23,16 +22,6 @@ import ( | |
| "github.com/slack-go/slack" | ||
| ) | ||
|
|
||
| // playgroundChannelBlacklist sets a list of channels the playground uploader will | ||
| // not operate in | ||
| var playgroundChannelBlacklist = []string{ | ||
| "C4U9J9QBT", // #admin-help | ||
| "C029RQSEG", // #random | ||
| "G1L7RN06B", // admin private channel | ||
| "G207C8R1R", // gobridge ops chanel | ||
| "GB1KBRGKA", // modnar (private random channel) | ||
| } | ||
|
|
||
| func getSelf(c *slack.Client) (*slack.User, error) { | ||
| // full lifetime of this function | ||
| ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) | ||
|
|
@@ -69,7 +58,7 @@ func runServer(cfg config.C, logger zerolog.Logger) error { | |
|
|
||
| sc := slack.New(cfg.Slack.BotAccessToken, slack.OptionHTTPClient(newHTTPClient())) | ||
|
|
||
| // test credentails and get self reference | ||
| // test credentials and get self reference | ||
| self, err := getSelf(sc) | ||
| if err != nil { | ||
| return err | ||
|
|
@@ -107,7 +96,7 @@ func runServer(cfg config.C, logger zerolog.Logger) error { | |
|
|
||
| cCache := cache.NewChannel(rc) | ||
|
|
||
| // set up the workqueue | ||
| // set up the work queue | ||
| q, err := workqueue.New(workqueue.Config{ | ||
| ConsumerName: cfg.Heroku.DynoID, | ||
| ConsumerGroup: cfg.Heroku.AppName, | ||
|
|
@@ -157,11 +146,6 @@ func runServer(cfg config.C, logger zerolog.Logger) error { | |
| // handle "define " prefixed command | ||
| ma.HandlePrefix(glossary.Prefix, "find a definition in the glossary of Go-related terms", gloss.DefineHandler) | ||
|
|
||
| // set up the Go Playground uploader | ||
| lp := logger.With().Str("context", "playground") | ||
| pg := playground.New(newHTTPClient(), lp.Logger(), playgroundChannelBlacklist) | ||
| ma.HandleDynamic(pg.MessageMatchFn, pg.Handler) | ||
|
|
||
| injectTeamJoinHandlers(tja) | ||
| injectChannelJoinHandlers(cja) | ||
|
|
||
|
|
@@ -201,7 +185,6 @@ func newHTTPTransport() *http.Transport { | |
| DialContext: (&net.Dialer{ | ||
| Timeout: 10 * time.Second, | ||
| KeepAlive: 30 * time.Second, | ||
| DualStack: true, | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why this change?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. DualStack is deprecated, see https://pkg.go.dev/net#Dialer.DualStack |
||
| }).DialContext, | ||
| MaxIdleConns: 100, | ||
| IdleConnTimeout: 60 * time.Second, | ||
|
|
||
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.
My language choice here was intentional.