Where are scheduled tasks controlled from?

When we had our data migrated from phpbb3 by Discourse, we had over 75K accounts that were copied over. Only about 2000 of them had ever posted on the old Forums, and only a few hundred in the last two years. Many of the rest were likely bogus accounts created years ago during one of several waves of bogus signups. (The good news is I haven’t seen even one new signup since migration that I would call bogus, I guess the updated site hasn’t hit the hacker cookbooks yet.)

It appears that every day some automated task is purging a block of them, all appear to be migrated users (TL0) with no posts and no activity of any kind since migration. We’re now down to about 37K accounts, and I suspect it may drop down to well under 5K before it levels off.

Where are these scheduled tasks being controlled from? Are there parameters that can be modified to alter when an account is deleted and how many can be deleted at each cycle? (It appears to be doing 1000 at a time.)

I’m not objecting to these deletions, I just want to know more about them.


If you search for Jobs::Scheduled you should find them in the codebase.

This particular one is likely CleanUpInactiveUsers which removes users with no posts who have not seen in clean_up_inactive_users_after_days (and several other conditions you see in the code).