Skip to content

Add a command to show info about a background job and force-execute it - #27217

Merged
skjnldsv merged 5 commits into
masterfrom
techdebt/noid/make-debugging-a-cron-job-easier
Oct 15, 2021
Merged

Add a command to show info about a background job and force-execute it#27217
skjnldsv merged 5 commits into
masterfrom
techdebt/noid/make-debugging-a-cron-job-easier

Conversation

@nickvergessen

@nickvergessennickvergessen commented May 28, 2021

Copy link
Copy Markdown
Member
occ background:job 64 --force-execute Job class: OCA\Files_Retention\BackgroundJob\RetentionJob
Arguments: {"tag":2}
Type: timed
Last checked: 1970-01-01T00:00:00+00:00
Reserved at: -
Last executed: 2021-05-28T12:57:12+00:00
Last duration: 0
Next execution: 2021-05-29T12:57:12+00:00
Forcing execution of the job
Job executed!
Job class: OCA\Files_Retention\BackgroundJob\RetentionJob
Arguments: {"tag":2}
Type: timed
Last checked: 1970-01-01T00:00:00+00:00
Reserved at: -
Last executed: 2021-05-28T12:57:23+00:00
Last duration: 1
Next execution: 2021-05-29T12:57:23+00:00

The second job info is only printed for "timed" jobs that are not deleted while being executed.

@nickvergessennickvergessen added 3. to review Waiting for reviews technical debt 🧱 🤔🚀 labels May 28, 2021
@nickvergessennickvergessen added this to the Nextcloud 22 milestone May 28, 2021

@ChristophWurstChristophWurst left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the command, but the implementation feels a bit fragile 🙈

can we leave any job list related responsibility in the job list code and only fetch/invoke the job from the new command?

Comment threadcore/Command/Background/Job.php Outdated
Comment threadcore/Command/Background/Job.php Outdated
Comment threadcore/Command/Background/Job.php Outdated
@skjnldsvskjnldsv added 2. developing Work in progress and removed 3. to review Waiting for reviews labels May 28, 2021
@szaimenszaimen linked an issue May 31, 2021 that may be closed by this pull request
@nickvergessen
nickvergessenforce-pushed the techdebt/noid/make-debugging-a-cron-job-easier branch from 956d663 to 27ee8a7CompareMay 31, 2021 15:16
@nickvergessennickvergessen added 3. to review Waiting for reviews and removed 2. developing Work in progress labels May 31, 2021
@blizzzblizzz mentioned this pull request Jun 2, 2021
57 tasks
@MichaIng

Copy link
Copy Markdown
Member

This is great, I was always looking for such a feature. Would it be possible to add some kind of list command to list all registered background jobs, theirs IDs, schedule, last execution etc, e.g. in a table-ish print? But that's better an own PR.

@nickvergessen
nickvergessenforce-pushed the techdebt/noid/make-debugging-a-cron-job-easier branch from 2ee7531 to 340cfacCompareJune 8, 2021 08:14
@skjnldsvskjnldsv added 4. to release Ready to be released and/or waiting for tests to finish and removed 3. to review Waiting for reviews labels Oct 13, 2021
@nickvergessen
nickvergessenforce-pushed the techdebt/noid/make-debugging-a-cron-job-easier branch from 340cfac to a68c891CompareOctober 13, 2021 09:48
@nickvergessen

Copy link
Copy Markdown
MemberAuthor

Rebased cleanly and adjusted since versions to 23

Signed-off-by: Joas Schilling <coding@schilljs.com>
Signed-off-by: Joas Schilling <coding@schilljs.com>
Signed-off-by: Joas Schilling <coding@schilljs.com>
Signed-off-by: Joas Schilling <coding@schilljs.com>
Signed-off-by: Joas Schilling <coding@schilljs.com>
@nickvergessen
nickvergessenforce-pushed the techdebt/noid/make-debugging-a-cron-job-easier branch from a68c891 to 3adc997CompareOctober 14, 2021 07:59
@nickvergessen

Copy link
Copy Markdown
MemberAuthor

Rebased and bumped autoloader

@skjnldsv
skjnldsv merged commit f7a4ff4 into masterOct 15, 2021
@skjnldsv
skjnldsv deleted the techdebt/noid/make-debugging-a-cron-job-easier branch October 15, 2021 09:09
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

4. to releaseReady to be released and/or waiting for tests to finishtechnical debt🧱 🤔🚀

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement occ system:cron like in owncloud

5 participants

@nickvergessen@MichaIng@ChristophWurst@blizzz@skjnldsv