mirror of
https://github.com/christianselig/apollo-backend
synced 2024-11-13 07:27:43 +00:00
timeout reddit and increase batches
This commit is contained in:
parent
55c45592ac
commit
8a777d2ee6
2 changed files with 3 additions and 2 deletions
|
@ -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
|
||||
|
|
|
@ -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}
|
||||
|
||||
|
|
Loading…
Reference in a new issue