From bb823c323be0f9f092db755723a91412687b81d2 Mon Sep 17 00:00:00 2001 From: Michael Date: Mon, 30 Nov 2020 21:40:55 +0000 Subject: [PATCH] Configuration for the priority of the notification for expired messages --- src/Model/Item.php | 8 ++++++-- static/defaults.config.php | 4 ++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/Model/Item.php b/src/Model/Item.php index d5f5031561..a8402a283b 100644 --- a/src/Model/Item.php +++ b/src/Model/Item.php @@ -1186,7 +1186,9 @@ class Item self::markForDeletion(['uri' => $item['uri'], 'deleted' => false], $priority); // send the notification upstream/downstream - Worker::add(['priority' => $priority, 'dont_fork' => true], "Notifier", Delivery::DELETION, intval($item['id'])); + if ($priority) { + Worker::add(['priority' => $priority, 'dont_fork' => true], "Notifier", Delivery::DELETION, intval($item['id'])); + } } elseif ($item['uid'] != 0) { Post\User::update($item['uri-id'], $item['uid'], ['hidden' => true]); @@ -3111,6 +3113,8 @@ class Item $expired = 0; + $priority = DI::config()->get('system', 'expire-notify-priority'); + while ($item = Item::fetch($items)) { // don't expire filed items @@ -3130,7 +3134,7 @@ class Item continue; } - self::markForDeletionById($item['id'], PRIORITY_LOW); + self::markForDeletionById($item['id'], $priority); ++$expired; } diff --git a/static/defaults.config.php b/static/defaults.config.php index b51b5935ad..f70bf8c8f6 100644 --- a/static/defaults.config.php +++ b/static/defaults.config.php @@ -237,6 +237,10 @@ return [ // restricts develop log writes to requests originating from this IP address. 'dlogip' => '', + // expire-notify-priority (integer) + // Priority for the expirary notification + 'expire-notify-priority' => PRIORITY_LOW, + // free_crawls (Integer) // Number of "free" searches when system => permit_crawling is enabled. 'free_crawls' => 10,