element-hq / element-hq/synapse
Make it possible to configure repeat interval of background jobs
- Dominant language
- Python
- Stars
- 4.6k
- Forks
- 600
- Avg merge
- 5d 22h
- Merged PRs (30d)
- 51
Description
**Description:**
I noticed that `prune_old_user_ips` is executed quite often ([every 5s](https://github.com/element-hq/synapse/blob/938c97416d2f3f1e248b2e208fa14874103c5bcc/synapse/storage/databases/main/client_ips.py#L440)) and wanted to lower the execution interval a bit to reduce server load, however it looks like it's currently not possible to do this at runtime.
It would be nice if the repeat interval of background jobs would be configurable somewhere.
Contributor guide
Research direction
Start with synapse/storage/databases/main/client_ips.py, especially the prune_old_user_ips call around the linked line, and trace how background jobs are scheduled and configured at runtime. Define how an interval setting would be exposed and applied consistently, then verify that the job can run at the configured frequency without increasing server load unexpectedly.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100