Changed worker order

This commit is contained in:
Michael 2021-03-02 07:06:22 +00:00
parent a228183abb
commit c740509a22
3 changed files with 6 additions and 7 deletions

View File

@ -108,7 +108,7 @@ class Cron
Worker::add(PRIORITY_LOW, 'UpdatePhotoAlbums'); Worker::add(PRIORITY_LOW, 'UpdatePhotoAlbums');
Worker::add(PRIORITY_LOW, 'Expire'); Worker::add(PRIORITY_LOW, 'ExpirePosts');
Worker::add(PRIORITY_LOW, 'ExpireConversations'); Worker::add(PRIORITY_LOW, 'ExpireConversations');

View File

@ -76,8 +76,6 @@ class Expire
Logger::notice('calling hooks done'); Logger::notice('calling hooks done');
Worker::add(['priority' => $a->queue['priority'], 'dont_fork' => true], 'ExpirePosts');
return; return;
} }
} }

View File

@ -38,16 +38,17 @@ class ExpirePosts
*/ */
public static function execute() public static function execute()
{ {
$a = DI::app();
self::deleteExpiredOriginPosts(); self::deleteExpiredOriginPosts();
self::deleteUnusedItemUri(); self::deleteUnusedItemUri();
self::deleteExpiredExternalPosts(); self::deleteExpiredExternalPosts();
// Set the expiry for origin posta
Worker::add(PRIORITY_LOW, 'Expire');
// update nodeinfo data after everything is cleaned up // 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); 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`)"]; $condition = ["NOT EXISTS (SELECT `uri-id` FROM `post-user` WHERE `post-user`.`uri-id` = `post`.`uri-id`)"];
DBA::delete('post', $condition); DBA::delete('post', $condition);
Logger::info('Orphaned post entries deleted', ['rows' => DBA::affectedRows()]); Logger::info('Orphaned post entries deleted', ['rows' => DBA::affectedRows()]);