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

Quand une syndication part en timeout, la considérer comme si elle était 'off'

parent a3ea9687
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -656,7 +656,10 @@ function syndic_a_jour($now_id_syndic, $statut = 'off') { ...@@ -656,7 +656,10 @@ function syndic_a_jour($now_id_syndic, $statut = 'off') {
// Section critique : n'autoriser qu'une seule syndication // Section critique : n'autoriser qu'une seule syndication
// simultanee pour un site donne // simultanee pour un site donne
if (!spip_get_lock("syndication $url_syndic")) return; if (!spip_get_lock("syndication $url_syndic")) {
spip_log("lock pour $url_syndic");
return;
}
spip_query("UPDATE spip_syndic SET syndication='$statut', spip_query("UPDATE spip_syndic SET syndication='$statut',
date_syndic=NOW() WHERE id_syndic='$now_id_syndic'"); date_syndic=NOW() WHERE id_syndic='$now_id_syndic'");
...@@ -788,7 +791,7 @@ function afficher_sites($titre_table, $requete) { ...@@ -788,7 +791,7 @@ function afficher_sites($titre_table, $requete) {
$title = _T('info_site_refuse'); $title = _T('info_site_refuse');
break; break;
} }
if ($syndication == "off") { if ($syndication == 'off' OR $syndication == 'sus') {
$puce = 'puce-orange-anim.gif'; $puce = 'puce-orange-anim.gif';
$title = _T('info_panne_site_syndique'); $title = _T('info_panne_site_syndique');
} }
...@@ -817,17 +820,17 @@ function afficher_sites($titre_table, $requete) { ...@@ -817,17 +820,17 @@ function afficher_sites($titre_table, $requete) {
$s = ""; $s = "";
//echo "<td class='arial1' align='right'> &nbsp;"; //echo "<td class='arial1' align='right'> &nbsp;";
if ($syndication == "off") { if ($syndication == 'off' OR $syndication == 'sus') {
$s .= "<font color='red'>"._T('info_probleme_grave')." </font>"; $s .= "<font color='red'>"._T('info_probleme_grave')." </font>";
} }
if ($syndication == "oui" or $syndication == "off"){ if ($syndication == "oui" or $syndication == "off" OR $syndication == 'sus'){
$s .= "<font color='red'>"._T('info_syndication')."</font>"; $s .= "<font color='red'>"._T('info_syndication')."</font>";
} }
$vals[] = $s; $vals[] = $s;
//echo "</td>"; //echo "</td>";
//echo "<td class='arial1'>"; //echo "<td class='arial1'>";
$s = ""; $s = "";
if ($syndication == "oui" OR $syndication == "off") { if ($syndication == "oui" OR $syndication == "off" OR $syndication == "sus") {
$result_art = spip_query("SELECT COUNT(*) FROM spip_syndic_articles WHERE id_syndic='$id_syndic'"); $result_art = spip_query("SELECT COUNT(*) FROM spip_syndic_articles WHERE id_syndic='$id_syndic'");
list($total_art) = spip_fetch_array($result_art); list($total_art) = spip_fetch_array($result_art);
$s .= " $total_art "._T('info_syndication_articles'); $s .= " $total_art "._T('info_syndication_articles');
...@@ -1019,11 +1022,15 @@ function afficher_syndic_articles($titre_table, $requete, $afficher_site = false ...@@ -1019,11 +1022,15 @@ function afficher_syndic_articles($titre_table, $requete, $afficher_site = false
function executer_une_syndication() { function executer_une_syndication() {
$id_syndic = 0; $id_syndic = 0;
if ($row = spip_fetch_array(spip_query("SELECT * FROM spip_syndic WHERE syndication='sus' AND statut='publie' AND date_syndic < DATE_SUB(NOW(), INTERVAL 24 HOUR) ORDER BY date_syndic LIMIT 0,1"))) {
// On va tenter un site 'sus' ou 'off' de plus de 24h, et le passer en 'off'
// s'il echoue
if ($row = spip_fetch_array(spip_query("SELECT * FROM spip_syndic WHERE syndication IN ('sus','off') AND statut='publie' AND date_syndic < DATE_SUB(NOW(), INTERVAL 24 HOUR) ORDER BY date_syndic LIMIT 0,1"))) {
$id_syndic = $row["id_syndic"]; $id_syndic = $row["id_syndic"];
syndic_a_jour($id_syndic); syndic_a_jour($id_syndic, 'off');
} }
// Et un site 'oui' de plus de 2 heures, qui passe en 'sus' s'il echoue
if ($row = spip_fetch_array(spip_query("SELECT * FROM spip_syndic WHERE syndication='oui' AND statut='publie' AND date_syndic < DATE_SUB(NOW(), INTERVAL 2 HOUR) ORDER BY date_syndic LIMIT 0,1"))) { if ($row = spip_fetch_array(spip_query("SELECT * FROM spip_syndic WHERE syndication='oui' AND statut='publie' AND date_syndic < DATE_SUB(NOW(), INTERVAL 2 HOUR) ORDER BY date_syndic LIMIT 0,1"))) {
$id_syndic = $row["id_syndic"]; $id_syndic = $row["id_syndic"];
syndic_a_jour($id_syndic, 'sus'); syndic_a_jour($id_syndic, 'sus');
......
...@@ -375,7 +375,7 @@ else ...@@ -375,7 +375,7 @@ else
// //
if (lire_meta('activer_syndic') != 'non' AND $connect_statut == '0minirezo' AND $connect_toutes_rubriques) { if (lire_meta('activer_syndic') != 'non' AND $connect_statut == '0minirezo' AND $connect_toutes_rubriques) {
include_ecrire("inc_sites.php3"); include_ecrire("inc_sites.php3");
afficher_sites(afficher_plus('sites_tous.php3')._T('avis_sites_syndiques_probleme'), "SELECT * FROM spip_syndic WHERE syndication='off' AND statut='publie' ORDER BY nom_site"); afficher_sites(afficher_plus('sites_tous.php3')._T('avis_sites_syndiques_probleme'), "SELECT * FROM spip_syndic WHERE (syndication='off' OR syndication='sus') AND statut='publie' ORDER BY nom_site");
} }
// Les articles syndiques en attente de validation // Les articles syndiques en attente de validation
......
...@@ -332,7 +332,7 @@ if (!$relief AND lire_meta('activer_syndic') != 'non') { ...@@ -332,7 +332,7 @@ if (!$relief AND lire_meta('activer_syndic') != 'non') {
} }
if (!$relief AND lire_meta('activer_syndic') != 'non' AND $connect_statut == '0minirezo' AND $connect_toutes_rubriques) { if (!$relief AND lire_meta('activer_syndic') != 'non' AND $connect_statut == '0minirezo' AND $connect_toutes_rubriques) {
$query = "SELECT id_syndic FROM spip_syndic WHERE id_rubrique='$id_rubrique' AND syndication='off' LIMIT 0,1"; $query = "SELECT id_syndic FROM spip_syndic WHERE id_rubrique='$id_rubrique' AND (syndication='off' OR syndication='sus') LIMIT 0,1";
$result = spip_query($query); $result = spip_query($query);
$relief = (spip_num_rows($result) > 0); $relief = (spip_num_rows($result) > 0);
} }
...@@ -369,7 +369,7 @@ if ($relief) { ...@@ -369,7 +369,7 @@ if ($relief) {
if (lire_meta('activer_syndic') != 'non' AND $connect_statut == '0minirezo' AND $connect_toutes_rubriques) { if (lire_meta('activer_syndic') != 'non' AND $connect_statut == '0minirezo' AND $connect_toutes_rubriques) {
include_ecrire("inc_sites.php3"); include_ecrire("inc_sites.php3");
afficher_sites(_T('avis_sites_syndiques_probleme'), afficher_sites(_T('avis_sites_syndiques_probleme'),
"SELECT * FROM spip_syndic WHERE id_rubrique='$id_rubrique' AND syndication='off' AND statut='publie' ORDER BY nom_site"); "SELECT * FROM spip_syndic WHERE id_rubrique='$id_rubrique' AND (syndication='off' OR syndication='sus') AND statut='publie' ORDER BY nom_site");
} }
// Les articles syndiques en attente de validation // Les articles syndiques en attente de validation
...@@ -424,7 +424,7 @@ if ($id_parent == "0" AND $id_rubrique != "0" AND $activer_breves!="non"){ ...@@ -424,7 +424,7 @@ if ($id_parent == "0" AND $id_rubrique != "0" AND $activer_breves!="non"){
if (lire_meta("activer_sites") == 'oui') { if (lire_meta("activer_sites") == 'oui') {
include_ecrire("inc_sites.php3"); include_ecrire("inc_sites.php3");
afficher_sites(_T('titre_sites_references_rubrique'), "SELECT * FROM spip_syndic WHERE id_rubrique='$id_rubrique' AND statut!='refuse' AND statut != 'prop' AND syndication != 'off' ORDER BY nom_site"); afficher_sites(_T('titre_sites_references_rubrique'), "SELECT * FROM spip_syndic WHERE id_rubrique='$id_rubrique' AND statut!='refuse' AND statut != 'prop' AND syndication NOT IN ('off','sus') ORDER BY nom_site");
$proposer_sites=lire_meta("proposer_sites"); $proposer_sites=lire_meta("proposer_sites");
if ($id_rubrique > 0 AND ($flag_editable OR $proposer_sites > 0)) { if ($id_rubrique > 0 AND ($flag_editable OR $proposer_sites > 0)) {
......
...@@ -269,7 +269,7 @@ debut_droite(); ...@@ -269,7 +269,7 @@ debut_droite();
debut_cadre_relief("site-24.gif"); debut_cadre_relief("site-24.gif");
echo "<center>"; echo "<center>";
if ($syndication == 'off') { if ($syndication == 'off' OR $syndication == 'sus') {
$logo_statut = "puce-orange-anim.gif"; $logo_statut = "puce-orange-anim.gif";
} }
else if ($statut == 'publie') { else if ($statut == 'publie') {
...@@ -367,7 +367,7 @@ if ($syndication == "oui" OR $syndication == "off" OR $syndication == "sus") { ...@@ -367,7 +367,7 @@ if ($syndication == "oui" OR $syndication == "off" OR $syndication == "sus") {
if ($erreur_syndic) if ($erreur_syndic)
echo "<p><font color=red><b>$erreur_syndic</b></font>"; echo "<p><font color=red><b>$erreur_syndic</b></font>";
if ($syndication == "off") { if ($syndication == "off" OR $syndication=="sus") {
debut_boite_info(); debut_boite_info();
echo _T('avis_site_syndique_probleme', array('url_syndic' => $url_syndic)); echo _T('avis_site_syndique_probleme', array('url_syndic' => $url_syndic));
echo "<center><b>"; echo "<center><b>";
......
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