• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Freegle / Iznik / 12171 / 12171
73%
master: 73%

Build:
DEFAULT BRANCH: master
Ran 10 May 2026 11:22AM UTC
Files 121
Run time 3s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

10 May 2026 09:28AM UTC coverage: 81.28%. Remained the same
12171

push

circleci

invalid-email-address
perf(microvolunteering): hoist eligibility filter outside per-message loop

V1 (cron/microvolunteering.php → MicroVolunteering::notifyForMessages())
ran a `memberships ⨝ users LEFT JOIN users_notifications … ORDER BY RAND()
LIMIT 10` candidate query for every pending/approved message — ~1900
queries per run, each evaluating the LEFT JOIN against `users_notifications`
for every member of the group. Cron tick took ~3 minutes.

Refactored to:

  1. One run-wide SELECT building {touser => true} for users with any
     microvolunteering Exhort notification in the last 24 h. This is the
     filter the per-message LEFT JOIN was implementing — pulling it out
     means subsequent per-message work can do it in O(1) PHP lookups.
  2. Per (group, collection-type), one SELECT for the active member pool
     (memberships ⨝ users with lastaccess/trust/role predicates only).
     Cached for the run.
  3. Per message, an in-PHP filter (drop poster, anyone in
     notifiedThisRun, anyone in alreadyNotifiedToday) followed by
     array_rand for the random sample. No DB.

Same fairness property as V1 — uniform random sampling per message —
and the MAX_PER_USER existence-check stays in the inner loop. The
schedule is restored to V1's `*/5` (the merge had set it to hourly,
which would have let messages wait up to an hour for review attention).

Live dry-run on prod went from ~3 min (V1 cadence) to ~21 s.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

24679 of 30363 relevant lines covered (81.28%)

51.79 hits per line

Source Files on job go - 12171
  • Tree
  • List 121
  • Changed 0
  • Source Changed 0
  • Coverage Changed 0
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 12171
  • CircleCI Build #12171
  • bdfc3e6f on github
  • Prev Job for on master (#11933)
  • Next Job for on master (#12501)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc