X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FWorker%2FExpire.php;h=713bfa25e0ad67f6a6f9caab456ba5de7375dffd;hb=1e9bff88bc05fce154edee9f047e7d8922184140;hp=cf6e78cb7203d05618a246d6b25b4b61b550905e;hpb=29f7ebe307c22b275466390937b82ccb3820fb1c;p=friendica.git diff --git a/src/Worker/Expire.php b/src/Worker/Expire.php index cf6e78cb72..713bfa25e0 100644 --- a/src/Worker/Expire.php +++ b/src/Worker/Expire.php @@ -26,9 +26,12 @@ class Expire { if ($param == 'delete') { logger('Delete expired items', LOGGER_DEBUG); // physically remove anything that has been deleted for more than two months - $r = dba::p("SELECT `id` FROM `item` WHERE `deleted` AND `changed` < UTC_TIMESTAMP() - INTERVAL 60 DAY"); + $r = dba::p("SELECT `id`, `icid` FROM `item` WHERE `deleted` AND `changed` < UTC_TIMESTAMP() - INTERVAL 60 DAY"); while ($row = dba::fetch($r)) { dba::delete('item', ['id' => $row['id']]); + if (!dba::exists('item', ['icid' => $row['icid']])) { + dba::delete('item-content', ['id' => $row['icid']]); + } } dba::close($r);