diff --git a/cmd/nourybot/main.go b/cmd/nourybot/main.go index 5f596a1..3e57134 100644 --- a/cmd/nourybot/main.go +++ b/cmd/nourybot/main.go @@ -118,11 +118,6 @@ func main() { "err", err, ) } - - sugar.Infow("db.Stats", - "db.Stats", db.Stats(), - ) - app := &application{ TwitchClient: tc, HelixClient: helixClient, @@ -132,6 +127,10 @@ func main() { Scheduler: cron.New(), } + app.Log.Infow("db.Stats", + "db.Stats", db.Stats(), + ) + // Received a PrivateMessage (normal chat message). app.TwitchClient.OnPrivateMessage(func(message twitch.PrivateMessage) { // sugar.Infow("New Twitch PrivateMessage", @@ -194,6 +193,7 @@ func main() { if err != nil { panic(err) } + } // openDB returns the sql.DB connection pool. diff --git a/internal/commands/download.go b/internal/commands/download.go index ecf0118..647c609 100644 --- a/internal/commands/download.go +++ b/internal/commands/download.go @@ -26,7 +26,7 @@ func Download(target, link string, tc *twitch.Client, log *zap.SugaredLogger) (r twitchClient: tc, } - dloader.dlxd(target, link) + go dloader.dlxd(target, link) return "" } @@ -113,7 +113,7 @@ func (dl *downloader) upload(target, path string) { } req.Header.Set("Content-Type", form.FormDataContentType()) - httpClient := http.Client{} + httpClient := http.DefaultClient resp, err := httpClient.Do(req) if err != nil { dl.twitchClient.Say(target, fmt.Sprintf("Something went wrong FeelsBadMan: %q", err))