Created
August 20, 2015 12:24
-
-
Save kikegarcia/45e3fc57ea8523c0f619 to your computer and use it in GitHub Desktop.
Consulta DB y con el valor recogido comprobamos que no hay un proceso corriendo con dicha PID en el servidor
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
function checkForcedDistributionInCourse() { | |
global $DB; | |
$db_cron_pid = $DB->get_record('config_plugins', array( | |
'plugin' => 'local_distr', | |
'name' => 'cron_active') | |
); | |
if ($db_cron_pid->value && file_exists( "/proc/$db_cron_pid->value" )){ | |
return -1; // En curso | |
} else { | |
return $db_cron_pid; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment