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

Rewrote scheduling code #17

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open

Rewrote scheduling code #17

wants to merge 8 commits into from

Conversation

KenStoneBlue
Copy link
Contributor

@KenStoneBlue KenStoneBlue commented Dec 22, 2019

This is not tested because I do not have an azure bi account.
This is a rewrite of the scheduling code.
The scheduler no longer needs to run each time the plugin is loaded.
All events are scheduled when the settings page is saved.
Also the UI for the settings has been updated.
Updated to include four events per day. This is now easily changeable by adding or removing from this array:
private $day_variations = array('_1', '_2', '_3', '_4');

Added a display of the next schedule for each event:
Next scheduled resume @ Tuesday, December 24, 2019, 0:00
Next scheduled suspend @ Tuesday, December 24, 2019, 0:10

added check for if POWER_BI_TIMEZONE is already defined
sku in the case that the update resource capacity fails
Mainly for debugging info and will most likely be removed prior to a real release
It non longer will try to schedule evertime the plugin is loaded but will setup the wp_events once when the settings page is saved
There is an issue with scheduling todays events that needs to be looked into.
Basically it will run todays events that have passed which when piled on top of one another could cause an issue.  The capacity update is robust enough to overcome this but the suspend and resume are not.
On the settings page added display of next scheduled event for each action
@KenStoneBlue KenStoneBlue marked this pull request as ready for review December 23, 2019 19:26
@KenStoneBlue
Copy link
Contributor Author

One thing I noticed is there isn't deactivate or activate functionality. There should be a deactivate function to remove scheduled events upon deactivation of the plugin. Then the activation function should reschedule these. This is an easy thing to add.
Unless it's in the code and I missed it. In that case it will be even easier to update these functions based on the new scheduling functionality.

Again this code is not tested as I do not have an azure BI account.

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