Skip to content

Commit

Permalink
Break knowledge of limits out of the Limiter and fix CertificatesPerD…
Browse files Browse the repository at this point in the history
…omainTransactions
  • Loading branch information
beautifulentropy committed Nov 30, 2023
1 parent 546a1a4 commit ed095ae
Show file tree
Hide file tree
Showing 9 changed files with 469 additions and 426 deletions.
6 changes: 5 additions & 1 deletion cmd/boulder-wfe2/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -340,15 +340,18 @@ func main() {
pendingAuthorizationLifetime := time.Duration(c.WFE.PendingAuthorizationLifetimeDays) * 24 * time.Hour

var limiter *ratelimits.Limiter
var txnBuilder *ratelimits.TransactionBuilder
var limiterRedis *bredis.Ring
if c.WFE.Limiter.Defaults != "" {
// Setup rate limiting.
limiterRedis, err = bredis.NewRingFromConfig(*c.WFE.Limiter.Redis, stats, logger)
cmd.FailOnError(err, "Failed to create Redis ring")

source := ratelimits.NewRedisSource(limiterRedis.Ring, clk, stats)
limiter, err = ratelimits.NewLimiter(clk, source, c.WFE.Limiter.Defaults, c.WFE.Limiter.Overrides, stats)
limiter, err = ratelimits.NewLimiter(clk, source, stats)
cmd.FailOnError(err, "Failed to create rate limiter")
txnBuilder, err = ratelimits.NewTransactionBuilder(c.WFE.Limiter.Defaults, c.WFE.Limiter.Overrides)
cmd.FailOnError(err, "Failed to create rate limits transaction builder")
}

var accountGetter wfe2.AccountGetter
Expand Down Expand Up @@ -380,6 +383,7 @@ func main() {
npKey,
accountGetter,
limiter,
txnBuilder,
)
cmd.FailOnError(err, "Unable to create WFE")

Expand Down
Loading

0 comments on commit ed095ae

Please sign in to comment.