Skip to content

Performance: EnqueueAnalyticsSummaryEmailsJob processes all accounts unnecessarily #44

@philipithomas

Description

@philipithomas

Description

In app/jobs/enqueue_analytics_summary_emails_job.rb:14-16:

Account.where(locked_at: nil).find_each do |account|
  AnalyticsSummaryEmailJob.perform_later(account)
end

This enqueues a job for every unlocked account every Monday, even those that haven't opted into analytics emails or have no recent activity.

Recommendation

Filter accounts to only those who should receive analytics emails.

Severity

Low

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions