Skip to content

Commit

Permalink
(BIDS-2872) wip
Browse files Browse the repository at this point in the history
  • Loading branch information
guybrush committed Feb 15, 2024
1 parent 308ff90 commit 037f63b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ratelimit/ratelimit.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down Expand Up @@ -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
}
Expand Down Expand Up @@ -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
}
Expand Down

0 comments on commit 037f63b

Please sign in to comment.