mirror of
https://github.com/christianselig/apollo-backend
synced 2024-11-22 03:37:43 +00:00
fix up for render
This commit is contained in:
parent
71f04afb8a
commit
e0579fbcbd
4 changed files with 9 additions and 11 deletions
|
@ -32,7 +32,7 @@ func APICmd(ctx context.Context) *cobra.Command {
|
|||
}
|
||||
defer statsd.Close()
|
||||
|
||||
db, err := cmdutil.NewDatabasePool(ctx, 32)
|
||||
db, err := cmdutil.NewDatabasePool(ctx, 1)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
|
@ -141,9 +141,11 @@ func cleanAccounts(ctx context.Context, logger *logrus.Logger, pool *pgxpool.Poo
|
|||
return
|
||||
}
|
||||
|
||||
logger.WithFields(logrus.Fields{
|
||||
"count": count,
|
||||
}).Info("cleaned stale accounts")
|
||||
if count > 0 {
|
||||
logger.WithFields(logrus.Fields{
|
||||
"count": count,
|
||||
}).Info("cleaned stale accounts")
|
||||
}
|
||||
}
|
||||
|
||||
func cleanQueues(ctx context.Context, logger *logrus.Logger, jobsConn rmq.Connection) {
|
||||
|
|
|
@ -32,11 +32,11 @@ func NewStatsdClient(tags ...string) (*statsd.Client, error) {
|
|||
tags = append(tags, fmt.Sprintf("env:%s", env))
|
||||
}
|
||||
|
||||
return statsd.New("127.0.0.1:8125", statsd.WithTags(tags))
|
||||
return statsd.New(os.Getenv("STATSD_URL"), statsd.WithTags(tags))
|
||||
}
|
||||
|
||||
func NewRedisClient(ctx context.Context) (*redis.Client, error) {
|
||||
opt, err := redis.ParseURL(os.Getenv("REDISCLOUD_URL"))
|
||||
opt, err := redis.ParseURL(os.Getenv("REDIS_URL"))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
|
@ -38,9 +38,7 @@ func (am *AccountModel) Upsert(a *Account) error {
|
|||
UPDATE SET
|
||||
access_token = $3,
|
||||
refresh_token = $4,
|
||||
expires_at = $5,
|
||||
last_message_id = $6,
|
||||
last_checked_at = $7
|
||||
expires_at = $5
|
||||
RETURNING id`
|
||||
return tx.QueryRow(
|
||||
am.ctx,
|
||||
|
@ -50,8 +48,6 @@ func (am *AccountModel) Upsert(a *Account) error {
|
|||
a.AccessToken,
|
||||
a.RefreshToken,
|
||||
a.ExpiresAt,
|
||||
a.LastMessageID,
|
||||
a.LastCheckedAt,
|
||||
).Scan(&a.ID)
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue