@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Garbage collect old notifications

Summary: Fixes T8473. Adds garbage collection to the `phabricator_feed.feed_storynotification` table.

Test Plan: Reduced the TTL to a really small value and ran the trigger daemon. Saw feed notifications removed from the database.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: epriestley, Korvin

Maniphest Tasks: T8473

Differential Revision: https://secure.phabricator.com/D13233

+27
+2
src/__phutil_library_map__.php
··· 763 763 'FeedPublisherWorker' => 'applications/feed/worker/FeedPublisherWorker.php', 764 764 'FeedPushWorker' => 'applications/feed/worker/FeedPushWorker.php', 765 765 'FeedQueryConduitAPIMethod' => 'applications/feed/conduit/FeedQueryConduitAPIMethod.php', 766 + 'FeedStoryNotificationGarbageCollector' => 'applications/notification/garbagecollector/FeedStoryNotificationGarbageCollector.php', 766 767 'FileAllocateConduitAPIMethod' => 'applications/files/conduit/FileAllocateConduitAPIMethod.php', 767 768 'FileConduitAPIMethod' => 'applications/files/conduit/FileConduitAPIMethod.php', 768 769 'FileCreateMailReceiver' => 'applications/files/mail/FileCreateMailReceiver.php', ··· 4048 4049 'FeedPublisherWorker' => 'FeedPushWorker', 4049 4050 'FeedPushWorker' => 'PhabricatorWorker', 4050 4051 'FeedQueryConduitAPIMethod' => 'FeedConduitAPIMethod', 4052 + 'FeedStoryNotificationGarbageCollector' => 'PhabricatorGarbageCollector', 4051 4053 'FileAllocateConduitAPIMethod' => 'FileConduitAPIMethod', 4052 4054 'FileConduitAPIMethod' => 'ConduitAPIMethod', 4053 4055 'FileCreateMailReceiver' => 'PhabricatorMailReceiver',
+22
src/applications/notification/garbagecollector/FeedStoryNotificationGarbageCollector.php
··· 1 + <?php 2 + 3 + final class FeedStoryNotificationGarbageCollector 4 + extends PhabricatorGarbageCollector { 5 + 6 + public function collectGarbage() { 7 + $ttl = 90 * 24 * 60 * 60; 8 + 9 + $table = new PhabricatorFeedStoryNotification(); 10 + $conn_w = $table->establishConnection('w'); 11 + 12 + queryfx( 13 + $conn_w, 14 + 'DELETE FROM %T WHERE chronologicalKey < (%d << 32) 15 + ORDER BY chronologicalKey ASC LIMIT 100', 16 + $table->getTableName(), 17 + time() - $ttl); 18 + 19 + return ($conn_w->getAffectedRows() == 100); 20 + } 21 + 22 + }
+3
src/applications/notification/storage/PhabricatorFeedStoryNotification.php
··· 28 28 'key_object' => array( 29 29 'columns' => array('primaryObjectPHID'), 30 30 ), 31 + 'key_chronological' => array( 32 + 'columns' => array('chronologicalKey'), 33 + ), 31 34 ), 32 35 ) + parent::getConfiguration(); 33 36 }