Add flood protection to cron

Created on 26 September 2011, about 14 years ago
Updated 29 October 2025, 6 days ago

This query from acitivity_cron is showing up in slow query logs on a client site.

 $uid_sql = "SELECT uid, min(created) as min, count(aid) as count FROM {activity} GROUP BY uid HAVING min < %d AND count > %d";

I can't yet find a way to optimize the query itself, however it seems like it'd be easy enough to use core's flood protection to prevent it from running every cron run - i.e. just run it once per day by default.

Should be able to get a patch for this going later.

📌 Task
Status

Closed: outdated

Version

2.0

Component

Code

Created by

🇬🇧United Kingdom catch

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

No activities found.

Production build 0.71.5 2024