Browse Source

contexte et intention précisée

master
JLuc 7 months ago
parent
commit
5edf6f8995
  1. 15
      inc/cachelab.php

15
inc/cachelab.php

@ -226,7 +226,7 @@ function cachelab_cibler(string $action, array $conditions = array(), array $opt
// ou que apcu ne suit plus
if (
(!($a_exists = apcu_exists($cle))) // cache apcu disparu
or $meta_derniere_modif > $d['creation_time'] // invalidation spip
or ($meta_derniere_modif > $d['creation_time']) // invalidation spip
or ($d['creation_time'] + $d['ttl'] <= $time) // cache APCU périmé
) {
if ($do_clean) {
@ -237,15 +237,16 @@ function cachelab_cibler(string $action, array $conditions = array(), array $opt
$ok_del = $Memoization->del ($memoiz_cle);
}
$trace = "\ncle=>$cle, \napcu_exists=>$a_exists, \nm_exists=>$m_exists,"
."\nmeta_derniere_modif=>$meta_derniere_modif, \ncreation=>{$d['creation_time']}, \nttl=>{$d['ttl']}, \nnow=>".time();
."\nmeta_derniere_modif=>$meta_derniere_modif, \ncreation=>{$d['creation_time']}, \nttl=>{$d['ttl']}, \nnow=>".time();
if ($a_exists and !$ok_del) {
$ok_del = apcu_delete($cle); // bourrin et souvent inutile d'après les logs. Log / est-ce parfois utile ?
if ($ok_del) {
spip_log("apcu_delete bourrin requis. ok_del=$ok_del $trace", 'cachelab_bourrin_UTILE');
}
}
if ($ok_del) {
$stats['nb_clean']++;
}
else {
$ok_del = apcu_delete($cle); // bourrin
spip_log("apcu_delete bourrin requis. ok_del=$ok_del $trace", 'cachelab_bourrin');
}
}
continue;
}

Loading…
Cancel
Save