Created
July 14, 2015 18:27
-
-
Save rscotton/a542f843ea2e80503424 to your computer and use it in GitHub Desktop.
Scholars@Duke Cron function
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* Scholars cron function | |
*/ | |
function dom_scholars_cron() { | |
if (time() > variable_get('dom_scholars_cron_last', 0)) { | |
//Sync all current nodes to Scholars (adds to queue in function) | |
_dom_scholars_update_content(); | |
watchdog('dom_scholars', 'Scholars - Update Content queued', array(), WATCHDOG_INFO); | |
//Check if organization is set, add missing nodes if necessary | |
_dom_scholars_sync_organization(); | |
watchdog('dom_scholars', 'Scholars - Sync Organization queued', array(), WATCHDOG_INFO); | |
//Set next batch sync for Scholars | |
variable_set('dom_scholars_cron_last', strtotime("Next Sunday 03:00")); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment