1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-03 09:49:28 +02:00

Merge pull request #9385 from Maikuolan/patch-0

Bug-fix (#9381).
This commit is contained in:
Daniel Neto 2024-09-09 09:05:12 -03:00 committed by GitHub
commit 54c72efb46
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 6 additions and 4 deletions

View file

@ -208,7 +208,7 @@ class sqlDAL
*
*/
_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`';

View file

@ -467,11 +467,13 @@ class Cache extends PluginAbstract {
$rows = Cache_schedule_delete::getAll();
Cache_schedule_delete::truncateTable();
if (is_iterable($rows)) {
foreach ($rows as $row) {
CacheDB::deleteCacheStartingWith($row['name'], false);
self::deleteCacheDir($row['name']);
}
}
}
}