Skip to content

Commit

Permalink
Merge pull request #9385 from Maikuolan/patch-0
Browse files Browse the repository at this point in the history
Bug-fix (#9381).
  • Loading branch information
DanielnetoDotCom authored Sep 9, 2024
2 parents 5ff1fda + 9d0eea5 commit 54c72ef
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion objects/mysql_dal.php
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ public static function writeSql($preparedStatement, $formats = "", $values = [],
*
*/

_error_log("writeSql [{$stmt->errno}] {$stmt->error} ".' '.json_encode(debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS))) . " userAgent=[{$_SERVER['HTTP_USER_AGENT']}]";
_error_log(sprintf('writeSql [%s] {%s} %s userAgent=[%s]', $stmt->errno, $stmt->error, json_encode(debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS)), $_SERVER['HTTP_USER_AGENT'] ?? '-'));
if($stmt->errno == 1205 && preg_match('/CachesInDB/', $preparedStatement)){//Lock wait timeout exceeded; try restarting transaction
_error_log("writeSql Recreate CachesInDB ");
$sql = 'DROP TABLE IF EXISTS `CachesInDB`';
Expand Down
8 changes: 5 additions & 3 deletions plugin/Cache/Cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -467,9 +467,11 @@ function executeEveryMinute() {

$rows = Cache_schedule_delete::getAll();
Cache_schedule_delete::truncateTable();
foreach ($rows as $row) {
CacheDB::deleteCacheStartingWith($row['name'], false);
self::deleteCacheDir($row['name']);
if (is_iterable($rows)) {
foreach ($rows as $row) {
CacheDB::deleteCacheStartingWith($row['name'], false);
self::deleteCacheDir($row['name']);
}
}
}

Expand Down

0 comments on commit 54c72ef

Please sign in to comment.