feat(notification): add interval for new question emails#1545
feat(notification): add interval for new question emails#1545AsyncAssassin wants to merge 1 commit into
Conversation
|
Thanks for working on this. The scope matches the discussion in #625, and the default One concern: the current implementation sleeps inside There is also a shutdown concern because the wait uses I think a better approach would be to move the throttled new-question email fan-out into a dedicated queue/worker:
This would keep the intended email throttling behavior while avoiding delays for unrelated external notifications and making shutdown behavior safer. |
Summary
Adds a configurable interval between email send attempts for new-question / followed-tag notification fan-out.
The interval is controlled by
NEW_QUESTION_NOTIFICATION_EMAIL_SEND_INTERVAL_SECONDS.The default is
0, so the current behavior is preserved unless the environment variable is explicitly set. Empty, invalid, negative, or overflowing values also fall back to0.Scope
This is based on the scope discussed in #625 and confirmed by @LinkinStars.
This PR only applies the delay to new-question notification email fan-out. It does not change:
EmailService.SendWhen the interval is enabled, plugin notifications are sent before the throttled email fan-out, so they are not delayed by the configured sleep.
Tests
Added focused tests for:
Validation: