diff --git a/internal/cmd/scheduler.go b/internal/cmd/scheduler.go index e2bbd3b..aeba7a6 100644 --- a/internal/cmd/scheduler.go +++ b/internal/cmd/scheduler.go @@ -19,7 +19,7 @@ import ( ) const ( - batchSize = 100 + batchSize = 200 checkTimeout = 60 // how long until we force a check enqueueTimeout = 5 // how long until we try to re-enqueue ) @@ -208,7 +208,7 @@ func enqueueAccounts(ctx context.Context, logger *logrus.Logger, statsd *statsd. last_enqueued_at < $1 OR last_checked_at < $2 ORDER BY last_checked_at - LIMIT 1000 + LIMIT 2000 ) UPDATE accounts SET last_enqueued_at = $3 diff --git a/internal/reddit/client.go b/internal/reddit/client.go index 31e9196..94393e3 100644 --- a/internal/reddit/client.go +++ b/internal/reddit/client.go @@ -70,6 +70,7 @@ func NewClient(id, secret string, statsd *statsd.Client, connLimit int) *Client t.MaxConnsPerHost = connLimit t.MaxIdleConnsPerHost = connLimit / 4 t.IdleConnTimeout = 10 * time.Second + t.ResponseHeaderTimeout = 5 * time.Second client := &http.Client{Transport: t}