mirror of
https://github.com/christianselig/apollo-backend
synced 2024-11-21 19:37:41 +00:00
close resultset earlier in scheduler
This commit is contained in:
parent
568ed6f51c
commit
782f77a7c4
1 changed files with 2 additions and 1 deletions
|
@ -474,7 +474,6 @@ func enqueueAccounts(ctx context.Context, logger *zap.Logger, statsd *statsd.Cli
|
||||||
logger.Error("failed to fetch accounts", zap.Error(err))
|
logger.Error("failed to fetch accounts", zap.Error(err))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
defer rows.Close()
|
|
||||||
|
|
||||||
var ids []string
|
var ids []string
|
||||||
for rows.Next() {
|
for rows.Next() {
|
||||||
|
@ -482,6 +481,8 @@ func enqueueAccounts(ctx context.Context, logger *zap.Logger, statsd *statsd.Cli
|
||||||
_ = rows.Scan(&id)
|
_ = rows.Scan(&id)
|
||||||
ids = append(ids, id)
|
ids = append(ids, id)
|
||||||
}
|
}
|
||||||
|
// Use this instead of deferring as we're going to take a while to get out of this method.
|
||||||
|
rows.Close()
|
||||||
|
|
||||||
chunks := [][]string{}
|
chunks := [][]string{}
|
||||||
chunkSize := int(math.Ceil(float64(len(ids)) / float64(accountEnqueueSeconds)))
|
chunkSize := int(math.Ceil(float64(len(ids)) / float64(accountEnqueueSeconds)))
|
||||||
|
|
Loading…
Reference in a new issue