@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.

Allow the PullLocal daemon to actually hibernate

Summary:
Ref T12298. The PullLocal daemon has had hibernation code for a little while, but it never actually activated because we don't sleep for more than 15 seconds in any case.

Add a maximum sleep instead and use that to control the longest sleep we'll do for hibernation purposes.

Also, when a repository or repository URI is edited, write a NEEDS_UPDATE event into the message table to make sure the daemons de-hibernate.

Test Plan: Used `bin/phd debug pull`, saw the daemon actually hibernate instead of just sleeping for 15 seconds.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T12298

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

+10 -1
+4
src/applications/diffusion/editor/DiffusionURIEditor.php
··· 507 507 ->synchronizeWorkingCopyAfterHostingChange(); 508 508 } 509 509 510 + $repository->writeStatusMessage( 511 + PhabricatorRepositoryStatusMessage::TYPE_NEEDS_UPDATE, 512 + null); 513 + 510 514 return $xactions; 511 515 } 512 516
+2 -1
src/applications/repository/daemon/PhabricatorRepositoryPullLocalDaemon.php
··· 68 68 $retry_after = array(); 69 69 70 70 $min_sleep = 15; 71 + $max_sleep = phutil_units('5 minutes in seconds'); 71 72 $max_futures = 4; 72 73 $futures = array(); 73 74 $queue = array(); ··· 228 229 continue; 229 230 } 230 231 231 - $should_hibernate = $this->waitForUpdates($min_sleep, $retry_after); 232 + $should_hibernate = $this->waitForUpdates($max_sleep, $retry_after); 232 233 if ($should_hibernate) { 233 234 break; 234 235 }
+4
src/applications/repository/editor/PhabricatorRepositoryEditor.php
··· 634 634 ->synchronizeWorkingCopyAfterCreation(); 635 635 } 636 636 637 + $object->writeStatusMessage( 638 + PhabricatorRepositoryStatusMessage::TYPE_NEEDS_UPDATE, 639 + null); 640 + 637 641 return $xactions; 638 642 } 639 643