Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add cron status badge to admin setting #2141

Merged
merged 1 commit into from
Mar 13, 2023
Merged

add cron status badge to admin setting #2141

merged 1 commit into from
Mar 13, 2023

Conversation

Grotax
Copy link
Member

@Grotax Grotax commented Mar 5, 2023

Summary

Display a info card in the settings, indicating when the last news update job ran.
screenshot_settings_1

Checklist

@Grotax
Copy link
Member Author

Grotax commented Mar 5, 2023

It's just a first draft. I haven't tested yet if the logic works.
Info would only refresh on page reload, but I think that is enough.
And I think this would help admins to debug issues.

In theory a button to unlock a stuck job would be possible.

@Grotax Grotax force-pushed the updater/status branch 4 times, most recently from d5f6409 to b17e982 Compare March 5, 2023 21:28
@Grotax
Copy link
Member Author

Grotax commented Mar 5, 2023

This feature will only be available in Nextcloud 26+, everything below will disable the box.

@Grotax
Copy link
Member Author

Grotax commented Mar 5, 2023

This is tested now and works like a charm, the formular is of course debatable.

return Date.now() / 1000 - this.lastCron > parseInt(this.updateInterval) * 2

Since the smaller the update interval gets the less likely it is that news will actually finish it's run in time.
Maybe we could add a +x that makes sure that we have at least 30, 15 min.

@Grotax Grotax marked this pull request as ready for review March 6, 2023 10:44
Display  a info card in the settings, indicating when the last news update job ran.

Signed-off-by: Benjamin Brahmer <info@b-brahmer.de>
@Grotax
Copy link
Member Author

Grotax commented Mar 13, 2023

I will merge this :)

@Grotax Grotax merged commit ea8002e into master Mar 13, 2023
@delete-merged-branch delete-merged-branch bot deleted the updater/status branch March 13, 2023 13:39
Grotax added a commit that referenced this pull request Mar 13, 2023
Changed
- Remove unused background job OCA\News\Cron\Updater (#2137)
- Add info card to the admin settings, showing last job execution (#2141)

Signed-off-by: Benjamin Brahmer <info@b-brahmer.de>
@Grotax Grotax mentioned this pull request Mar 13, 2023
Grotax added a commit that referenced this pull request Mar 13, 2023
Changed
- Remove unused background job OCA\News\Cron\Updater (#2137)
- Add info card to the admin settings, showing last job execution (#2141)

Signed-off-by: Benjamin Brahmer <info@b-brahmer.de>
@Grotax Grotax added this to the Improve background job milestone Mar 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant