use the right id field

This commit is contained in:
Andre Medeiros 2022-07-31 15:23:29 -04:00
parent bb2f709259
commit 13af0d1b4a

View file

@ -369,7 +369,7 @@ func enqueueStuckAccounts(ctx context.Context, logger *zap.Logger, statsd *stats
func enqueueAccounts(ctx context.Context, logger *zap.Logger, statsd *statsd.Client, pool *pgxpool.Pool, redisConn *redis.Client, luaSha string, queue rmq.Queue) { func enqueueAccounts(ctx context.Context, logger *zap.Logger, statsd *statsd.Client, pool *pgxpool.Pool, redisConn *redis.Client, luaSha string, queue rmq.Queue) {
now := time.Now() now := time.Now()
query := `SELECT id FROM accounts` query := `SELECT reddit_account_id FROM accounts`
rows, err := pool.Query(ctx, query) rows, err := pool.Query(ctx, query)
if err != nil { if err != nil {
logger.Error("failed to fetch accounts", zap.Error(err)) logger.Error("failed to fetch accounts", zap.Error(err))
@ -379,9 +379,9 @@ func enqueueAccounts(ctx context.Context, logger *zap.Logger, statsd *statsd.Cli
var ids []string var ids []string
for rows.Next() { for rows.Next() {
var id int64 var id string
_ = rows.Scan(&id) _ = rows.Scan(&id)
ids = append(ids, fmt.Sprintf("%d", id)) ids = append(ids, id)
} }
enqueued := 0 enqueued := 0