discourse/app
David Taylor c0293339b8
PERF: Do not enqueue digest emails when attempted recently (#10849)
Previously, Jobs::EnqueueDigestEmails would enqueue a digest job for every user, even if there are no topics to send. The digest job would exit, no email would send, and last_emailed_at would not change. 30 minutes later, Jobs::EnqueueDigestEmails would run again and re-enqueue jobs for the same users.

120fa8ad introduced a temporary mitigation for this issue, by randomly selecting a subset of those users each time.

This commit adds a new `digest_attempted_at` column to the `user_stats` table. This column is updated every time a digest job completes for a user. Using this, we can avoid scheduling digest jobs for the same user every 30 minutes. This also removes the random user selection in 120fa8ad, and instead prioritizes users who had digests attempted the longest time ago.
2020-10-07 15:30:38 +01:00
..
assets FIX: When admin changes an email for the user the user must confirm the change (#10830) 2020-10-07 13:02:24 +10:00
controllers FIX: When admin changes an email for the user the user must confirm the change (#10830) 2020-10-07 13:02:24 +10:00
helpers DEV: make it possible to enable cdn in development environment. 2020-09-23 11:52:16 +05:30
jobs PERF: Do not enqueue digest emails when attempted recently (#10849) 2020-10-07 15:30:38 +01:00
mailers FIX: When admin changes an email for the user the user must confirm the change (#10830) 2020-10-07 13:02:24 +10:00
models PERF: Do not enqueue digest emails when attempted recently (#10849) 2020-10-07 15:30:38 +01:00
serializers FIX: Do not downcase group name in current user serializer 2020-09-17 13:03:42 -04:00
services REFACTOR: Removes double check of site setting in badge granter 2020-10-05 19:59:57 +02:00
views FIX: Hide empty popular/recent sections in 404 page (#10811) 2020-10-02 15:11:15 -04:00