From 037f63b0f346f6c4eb0f21064efbc63e37e517ce Mon Sep 17 00:00:00 2001 From: Patrick Pfeiffer Date: Thu, 15 Feb 2024 09:37:27 +0100 Subject: [PATCH] (BIDS-2872) wip --- ratelimit/ratelimit.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ratelimit/ratelimit.go b/ratelimit/ratelimit.go index b5dc205c0e..8350d7cb9d 100644 --- a/ratelimit/ratelimit.go +++ b/ratelimit/ratelimit.go @@ -327,7 +327,7 @@ func updateWeights(firstRun bool) error { Bucket string `db:"bucket"` ValidFrom time.Time `db:"valid_from"` }{} - err := db.WriterDb.Select(&dbWeights, "SELECT DISTINCT ON (endpoint) endpoint, bucket, weight, valid_from FROM api_weights WHERE valid_from <= NOW() ORDER BY endpoint, valid_from DESC") + err := db.FrontendWriterDB.Select(&dbWeights, "SELECT DISTINCT ON (endpoint) endpoint, bucket, weight, valid_from FROM api_weights WHERE valid_from <= NOW() ORDER BY endpoint, valid_from DESC") if err != nil { return err } @@ -493,7 +493,7 @@ func updateStats(redisClient *redis.Client) error { } func updateStatsEntries(entries []DbEntry) error { - tx, err := db.WriterDb.Beginx() + tx, err := db.FrontendWriterDB.Beginx() if err != nil { return err } @@ -554,7 +554,7 @@ func updateRateLimits() error { lastTRateLimits := lastRateLimitUpdateRateLimits lastRateLimitUpdateMu.Unlock() - tx, err := db.WriterDb.Beginx() + tx, err := db.FrontendWriterDB.Beginx() if err != nil { return err }