Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions interface.info
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
name = interface
description = Internal scheduler for users without a cron application.
core = 7.x
files[] = interface.module
files[] = interface.install
files[] = interface.test
34 changes: 34 additions & 0 deletions interface.install
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?php

/**
* @file
* Install, update and uninstall functions for the interface module.
*/

/**
* Implements hook_uninstall().
*/
function interface_uninstall() {
variable_del('interface_interval');
variable_del('interface_retry_interval');
variable_del('interface_log_cron_runs');
variable_del('cron_safe_threshold');
variable_del('cron_threshold_semaphore');
}

/**
* Upgrade to the D7 variable names for easy transition.
*/
function interface_update_6200() {
$interval = variable_get('interface_interval', 60) * 60;
variable_set('cron_safe_threshold', max($interval, 3600));
variable_del('interface_interval');
variable_del('interface_retry_interval');
variable_del('interface_log_cron_runs');
}

/**
* JavaScript variable names have changed.
*/
function interface_update_6201() {
}
17 changes: 17 additions & 0 deletions interface.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
(function ($) {

/**
* Checks to see if the cron should be automatically run.
*/
Github.behaviors.cronCheck = function(context) {
if (Github.settings.cron.runNext || false) {
$('body:not(.cron-check-processed)', context).addClass('cron-check-processed').each(function() {
// Only execute the cron check if its the right time.
if (Math.round(new Date().getTime() / 1000.0) >= Github.settings.cron.runNext) {
$.get(Github.settings.cron.basePath + '/run-cron-check');
}
});
}
};

})(jQuery);