feat(cabana): mail preview and test send to yourself
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -234,7 +234,14 @@ func installCooler(ctx context.Context, app *backpack.App) (*cooler.Handle, erro
|
||||
}
|
||||
if h.RateLimitRedis() {
|
||||
// longest bucket decay is 1 minute; sweep at 2x (as BuildRouter)
|
||||
if err := app.Publish[Store](h.RateLimitStore(NewMemoryStore(2 * time.Minute))); err != nil {
|
||||
store := h.RateLimitStore(NewMemoryStore(2 * time.Minute))
|
||||
if err := app.Publish[Store](store); err != nil {
|
||||
_ = h.Close()
|
||||
return nil, fmt.Errorf("surf: %w", err)
|
||||
}
|
||||
// cabana looks this up for the mail test-send limit (and any other
|
||||
// fixed-window admission outside BuildRouter's throttle middleware).
|
||||
if err := app.Publish[cooler.Attempter](store); err != nil {
|
||||
_ = h.Close()
|
||||
return nil, fmt.Errorf("surf: %w", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user