AtlasPublicPolicy / power-bi-embedded

Use Power BI Embedded to embed dashboards, reports, report visuals, Q&A, and tiles in your WordPress website.
GNU General Public License v3.0
49 stars 34 forks source link

Rewrote scheduling code #17

Open KenStoneBlue opened 4 years ago

KenStoneBlue commented 4 years ago

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

KenStoneBlue commented 4 years ago

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.