X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FWorker%2FExpire.php;fp=src%2FWorker%2FExpire.php;h=a4342722d5f5f50b501ce6264c63c56db4e48e6b;hb=5af9596dde162b1b9819869e3d5129f571a1c503;hp=685fad49e8f64fc171946f3600203b26c5489d13;hpb=0b38f1c58b822ac1ec5a199de00f0a0631c01a61;p=friendica.git diff --git a/src/Worker/Expire.php b/src/Worker/Expire.php index 685fad49e8..a4342722d5 100644 --- a/src/Worker/Expire.php +++ b/src/Worker/Expire.php @@ -29,7 +29,7 @@ class Expire logger('Delete expired items', LOGGER_DEBUG); // physically remove anything that has been deleted for more than two months $condition = ["`deleted` AND `changed` < UTC_TIMESTAMP() - INTERVAL 60 DAY"]; - $rows = dba::select('item', ['id', 'iaid', 'icid'], $condition); + $rows = dba::select('item', ['id', 'iaid', 'icid', 'psid'], $condition); while ($row = dba::fetch($rows)) { dba::delete('item', ['id' => $row['id']]); if (!empty($row['iaid']) && !dba::exists('item', ['iaid' => $row['iaid']])) { @@ -38,6 +38,11 @@ class Expire if (!empty($row['icid']) && !dba::exists('item', ['icid' => $row['icid']])) { dba::delete('item-content', ['id' => $row['icid']]); } + // When the permission set will be used in photo and events as well. + // this query here needs to be extended. + if (!empty($row['psid']) && !dba::exists('item', ['psid' => $row['psid']])) { + dba::delete('permissionset', ['id' => $row['psid']]); + } } dba::close($rows);