-
Notifications
You must be signed in to change notification settings - Fork 179
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
occ news:updater:job exits with code 2 if last update was too long ago #2590
Conversation
Signed-off-by: mortee <mortee@kavemalna.hu>
I'm not sure what the goal of this is. |
Of course, when it comes to the News admin page indicating there's something wrong with the updater job, I need to take action. I need to make this status available outside of the visual feedback of the admin page. By being able to extract this from the occ console, I can make the appropriate alert for myself. |
lib/Command/Updater/Job.php
Outdated
$output->writeln("Last Execution was ".$date->format('Y-m-d H:i:s e'). | ||
$elapsedInterval->format("; %h hours, %i minutes, %s seconds ago")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we should change this to a relative time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just added the relative time display, next to the unchanged absolute one. At least for me, it's more relevant how long ago a last update was executed, than at what exact time it was. Can be taken out however, my main goal is the feedback through the exit code, so that scripts can act on it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Problem is that people might already have this scripted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another option could be adding a new command-line switch, which triggers this check, and the exit code. Thus no existing script would possibly break.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added a --check-elapsed
option to the command. Currently, if both are specified, the --reset
takes precedence.
I'm thinking either erroring out instead - or, better yet, maybe in that case the job could be automatically reset if it was executed too long ago, along with displaying the message. The docs might warn that this has its own risks, so should be used with caution.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, is this good as is, or I should do either of the above suggested changes?
Co-authored-by: Sean Molenaar <SMillerDev@users.noreply.github.com> Signed-off-by: mortee <mortee.github@kavemalna.hu>
Signed-off-by: Nextcloud bot <bot@nextcloud.com>
Co-authored-by: Sean Molenaar <SMillerDev@users.noreply.github.com> Signed-off-by: mortee <mortee.github@kavemalna.hu>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me now :)
Summary
lib/Command/Updater/Job.php
src/components/AdminSettings.vue