Last active
April 8, 2016 12:51
-
-
Save ianmjones/c60a98c56f57dcf3321c0946b9a9e4fe to your computer and use it in GitHub Desktop.
Simple runNow() function for wp-cron-pixie
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
runNow: function() { | |
// Only bother to run update if not due before next refresh. | |
var seconds_due = this.model.get( 'seconds_due' ); | |
if ( seconds_due > CronPixie.timer_period ) { | |
var timestamp = this.model.get( 'timestamp' ) - seconds_due; | |
this.model.save( | |
{ timestamp: timestamp, seconds_due: 0 } | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment