Skip to content

[Bug]: background-job:worker ignores interval argument #49584

Open
@daurnimator

Description

⚠️ This issue respects the following points: ⚠️

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 that interval is never used in the loop: all you get is the usleep(50000); at

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

  1. Run php occ background-job:worker --interval=60
  2. 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions