diff --git a/src/Worker/Cron.php b/src/Worker/Cron.php index c8ee97d0c..a0144e8a2 100644 --- a/src/Worker/Cron.php +++ b/src/Worker/Cron.php @@ -108,7 +108,7 @@ class Cron Worker::add(PRIORITY_LOW, 'UpdatePhotoAlbums'); - Worker::add(PRIORITY_LOW, 'Expire'); + Worker::add(PRIORITY_LOW, 'ExpirePosts'); Worker::add(PRIORITY_LOW, 'ExpireConversations'); diff --git a/src/Worker/Expire.php b/src/Worker/Expire.php index 769b0d048..1fb162db9 100644 --- a/src/Worker/Expire.php +++ b/src/Worker/Expire.php @@ -76,8 +76,6 @@ class Expire Logger::notice('calling hooks done'); - Worker::add(['priority' => $a->queue['priority'], 'dont_fork' => true], 'ExpirePosts'); - return; } } diff --git a/src/Worker/ExpirePosts.php b/src/Worker/ExpirePosts.php index 9e75ea66b..1130a62e4 100644 --- a/src/Worker/ExpirePosts.php +++ b/src/Worker/ExpirePosts.php @@ -38,16 +38,17 @@ class ExpirePosts */ public static function execute() { - $a = DI::app(); - self::deleteExpiredOriginPosts(); self::deleteUnusedItemUri(); self::deleteExpiredExternalPosts(); + // Set the expiry for origin posta + Worker::add(PRIORITY_LOW, 'Expire'); + // update nodeinfo data after everything is cleaned up - Worker::add(['priority' => $a->queue['priority'], 'created' => $a->queue['created'], 'dont_fork' => true], 'NodeInfo'); + Worker::add(PRIORITY_LOW, 'NodeInfo'); } /** @@ -70,7 +71,7 @@ class ExpirePosts } DBA::close($rows); - Logger::info('Deleting orphaned post entries- start'); + Logger::info('Deleting orphaned post entries - start'); $condition = ["NOT EXISTS (SELECT `uri-id` FROM `post-user` WHERE `post-user`.`uri-id` = `post`.`uri-id`)"]; DBA::delete('post', $condition); Logger::info('Orphaned post entries deleted', ['rows' => DBA::affectedRows()]);