[Bug]: background-job:worker
ignores interval argument #49584
Open
Description
⚠️ This issue respects the following points: ⚠️
- This is a bug, not a question or a configuration/webserver/proxy issue.
- This issue is not already reported on Github OR Nextcloud Community Forum (I've searched it).
- Nextcloud Server is up to date. See Maintenance and Release Schedule for supported versions.
- I agree to follow Nextcloud's Code of Conduct.
Bug description
I noticed high database usage for my background workers.
I was running the background jobs via php occ background-job:worker
The --help
output suggests that there is an interval of 5 seconds, configurable via -i
/--interval
.
But in reality it seems to run constantly.
Looking at the code in
it appears thatinterval
is never used in the loop: all you get is the usleep(50000);
at server/core/Command/Background/JobWorker.php
Line 103 in c3b336d
For now I've worked around locally with via using --once
and an external loop. But I'd love to see this fixed to avoid the overhead of a new process every time.
Steps to reproduce
- Run
php occ background-job:worker --interval=60
- Observe that it's running far more frequently than minutely
Expected behavior
--interval
argument to background-job:worker
should be respected
Nextcloud Server version
30
Operating system
Other
PHP engine version
None
Web server
Apache (supported)
Database engine version
PostgreSQL
Is this bug present after an update or on a fresh install?
None
Are you using the Nextcloud Server Encryption module?
None
What user-backends are you using?
- Default user-backend (database)
- LDAP/ Active Directory
- SSO - SAML
- Other
Configuration report
List of activated Apps
Nextcloud Signing status
Nextcloud Logs
Additional info
No response
Activity