Skip to content
Extraits de code Groupes Projets
Valider 35740e30 rédigé par Fil's avatar Fil
Parcourir les fichiers

plus jolis logs de spip_cron

parent 8d20150a
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -56,31 +56,35 @@ function spip_cron($taches=array()) {
}
}
if (!$taches) $taches = taches_generales();
if (!$taches)
$taches = taches_generales();
include_ecrire("inc_meta.php3");
foreach ($taches as $tache)
{
$lock = _DIR_SESSIONS . $tache . '.lock';
clearstatcache();
$last = (@file_exists($lock) ? filemtime($lock) : 0);
if (($t - $frequence_taches[$tache]) > $last) {
@touch($lock);
include_ecrire('inc_' . $tache . _EXTENSION_PHP);
$fonction = 'cron_' . $tache;
$code_de_retour = $fonction($t);
if ($code_de_retour) {
$msg = $GLOBALS['PHP_SELF'] . ": tache $tache";
if ($code_de_retour < 0) {
@touch($lock, $last);
spip_log($msg . " en cours");
foreach ($taches as $tache) {
$lock = _DIR_SESSIONS . $tache . '.lock';
clearstatcache();
$last = (@file_exists($lock) ? filemtime($lock) : 0);
if (($t - $frequence_taches[$tache]) > $last) {
@touch($lock);
spip_timer('tache');
include_ecrire('inc_' . $tache . _EXTENSION_PHP);
$fonction = 'cron_' . $tache;
$code_de_retour = $fonction($t);
if ($code_de_retour) {
$msg = "cron: $tache";
if ($code_de_retour < 0) {
@touch($lock, $last);
spip_log($msg . " (en cours, " . spip_timer('tache') .")");
spip_timer('tache');
}
else
spip_log($msg . " (" . spip_timer('tache') . ")");
break;
}
else spip_log($msg . " faite en " . (time() - $t) . " secondes");
break;
}
}
}
}
}
// Construction de la liste ordonnee des taches.
......
......@@ -200,11 +200,11 @@ function terminer_public_global($use_cache, $chemin_cache='') {
// Si on a pu utiliser un cache,
// il reste du temps pour une tache de fond, notamment le cache
if ($use_cache)
{
if ($use_cache) {
include_ecrire('inc_cron.php3');
spip_cron();
}
}
// Gestion des statistiques du site public
// (a la fin pour ne pas forcer le $db_ok)
if (lire_meta("activer_statistiques") != "non") {
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter