Created
March 28, 2014 00:54
-
-
Save m7v/9822675 to your computer and use it in GitHub Desktop.
Hook_cron
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
/** | |
* Implements hook_cron(). | |
*/ | |
function spaint_cache_cron() { | |
// Set interval for run cron. Default value is 1 day. | |
$interval = variable_get('spaint_cache_cron_interval', 86400); | |
if (time() >= variable_get('spaint_cache_cron_next_execution', 0)) { | |
spaint_cache_set_data_about_user_tracks(); | |
watchdog('success', t('Cache set for user\'s count tracks is successful')); | |
spaint_cache_set_data_about_user_votes(); | |
watchdog('success', t('Cache set for user\'s votes is successful')); | |
spaint_cache_set_data_about_tracks_votes(); | |
watchdog('success', t('Cache set for track\'s votes is successful')); | |
// Set interval for the next run cron. | |
variable_set('spaint_cache_cron_execution', time() + $interval); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment