Skip to content

Instantly share code, notes, and snippets.

@rscotton
Created July 14, 2015 18:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rscotton/a542f843ea2e80503424 to your computer and use it in GitHub Desktop.
Save rscotton/a542f843ea2e80503424 to your computer and use it in GitHub Desktop.
Scholars@Duke Cron function
<?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