From 34756a88d509fd7cefe422ad57cb23da9a62725d Mon Sep 17 00:00:00 2001 From: Antoine Pitrou <pitrou@free.fr> Date: Wed, 28 Jan 2004 00:06:46 +0000 Subject: [PATCH] =?UTF-8?q?mail=20quoi=20de=20neuf=20avant=20les=20statist?= =?UTF-8?q?iques=20(pour=20eviter=20qu'il=20ne=20soit=20jamais=20envoy?= =?UTF-8?q?=C3=A9=20sur=20sites=20=C3=A0=20tr=C3=A8s=20faible=20trafic)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ecrire/inc_cron.php3 | 60 ++++++++++++++++++++++---------------------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/ecrire/inc_cron.php3 b/ecrire/inc_cron.php3 index f04dc0cce1..6d566fd62e 100644 --- a/ecrire/inc_cron.php3 +++ b/ecrire/inc_cron.php3 @@ -67,36 +67,6 @@ function spip_cron() { include_ecrire("inc_meta.php3"); $t = time(); - if ($t - lire_meta('date_stats_referers') > 3600) - cron_referers($t); - - if (lire_meta('calculer_referers_now') == 'oui') - cron_referers_suite(); - - if (date("Y-m-d") <> ($last_date = lire_meta("date_statistiques"))) - cron_archiver_stats($last_date); - - if ($t - lire_meta('date_stats_popularite') > 1800) { - if (timeout('archiver_stats')) { - include_ecrire("inc_statistiques.php3"); - calculer_popularites(); - } - } - - // statistiques - if (lire_meta("activer_statistiques") != "non") { - if (timeout(false, false)) // no lock, no action - { - // Conditions declenchant un eventuel calcul des stats - if ((lire_meta('calculer_referers_now') == 'oui') - OR (date("Y-m-d") <> lire_meta("date_statistiques")) - OR (time() - lire_meta('date_stats_popularite') > 1800)) { - include_local ("inc-stats.php3"); - archiver_stats(); - } - } - } - // // Envoi du mail quoi de neuf @@ -127,6 +97,36 @@ function spip_cron() { } + // statistiques + if (lire_meta("activer_statistiques") != "non") { + if ($t - lire_meta('date_stats_referers') > 3600) + cron_referers($t); + + if (lire_meta('calculer_referers_now') == 'oui') + cron_referers_suite(); + + if (date("Y-m-d") <> ($last_date = lire_meta("date_statistiques"))) + cron_archiver_stats($last_date); + + if ($t - lire_meta('date_stats_popularite') > 1800) { + if (timeout('archiver_stats')) { + include_ecrire("inc_statistiques.php3"); + calculer_popularites(); + } + } + + if (timeout(false, false)) // no lock, no action + { + // Conditions declenchant un eventuel calcul des stats + if ((lire_meta('calculer_referers_now') == 'oui') + OR (date("Y-m-d") <> lire_meta("date_statistiques")) + OR (time() - lire_meta('date_stats_popularite') > 1800)) { + include_local ("inc-stats.php3"); + archiver_stats(); + } + } + } + // recalcul des rubriques publiques (cas de la publication post-datee) if (($t - lire_meta('calcul_rubriques') > 3600) AND timeout('calcul_rubriques')) { ecrire_meta('calcul_rubriques', $t); -- GitLab