system.cron.js 489 B

12345678910111213141516171819
  1. (function ($) {
  2. /**
  3. * Checks to see if the cron should be automatically run.
  4. */
  5. Drupal.behaviors.cronCheck = {
  6. attach: function(context, settings) {
  7. if (settings.cronCheck || false) {
  8. $('body').once('cron-check', function() {
  9. // Only execute the cron check if its the right time.
  10. if (Math.round(new Date().getTime() / 1000.0) > settings.cronCheck) {
  11. $.get(settings.basePath + 'system/run-cron-check');
  12. }
  13. });
  14. }
  15. }
  16. };
  17. })(jQuery);