-
Notifications
You must be signed in to change notification settings - Fork 897
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
[WIP] Change MiqRequest to use MiqSchedules for scheduled requests #17542
Conversation
This includes the change in #17520 |
Instead of using MiqQueue with deliver_on to run an MiqRequest later, create a run-once MiqSchedule record.
Some comments on commits bdunne/manageiq@d881e84~...a443211 spec/models/miq_schedule_spec.rb
|
Checked commits bdunne/manageiq@d881e84~...a443211 with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0 app/models/miq_request.rb
spec/models/miq_schedule_spec.rb
|
if get_option(:schedule_type) == "schedule" | ||
deliver_on = get_option(:schedule_time).utc rescue nil | ||
start_time = get_option(:schedule_time).utc rescue nil |
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.
D'oh I meant to put this here
Copying @gmcculloug 's comment (#17520 (comment))
I would recommend that we refactor this line. The classic UI sets get_option(:schedule_time) to a ActiveSupport::TimeWithZone object which supports the utc call.
I suspect that if this is set from the API or some other means it would set the time as a string in which case the code will silently error and use nil. It is also a good opportunity to get rid of the inline rescue as well.
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.
Fixed by #17547
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.
This looks good to me, I wonder if we should unify the invoke_actions in MiqSchedule eventually or add an action_create_miq_request_tasks
so it is consistent with how the rest of the actions are.
@agrare Yeah, I was hoping to remove the |
This pull request is not mergeable. Please rebase and repush. |
Closing since v2v is interacting with |
While working on the V2V project, there are a few use cases around scheduled requests that need some enhancements. In order to accommodate those use cases, it would be best to use schedules rather than queue items with a deliver on date.
Desired V2V features:
This is currently using a reserve column since it needs to be backported. I will create a followup PR here and in manageiq-schema to get out of the reserved attribute.
Follow-ups:
ManageIQ/manageiq-schema#212
#17545