Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14007681
D11795.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D11795.diff
View Options
diff --git a/src/applications/repository/daemon/PhabricatorRepositoryPullLocalDaemon.php b/src/applications/repository/daemon/PhabricatorRepositoryPullLocalDaemon.php
--- a/src/applications/repository/daemon/PhabricatorRepositoryPullLocalDaemon.php
+++ b/src/applications/repository/daemon/PhabricatorRepositoryPullLocalDaemon.php
@@ -27,6 +27,7 @@
final class PhabricatorRepositoryPullLocalDaemon
extends PhabricatorDaemon {
+ private $statusMessageCursor = 0;
/* -( Pulling Repositories )----------------------------------------------- */
@@ -259,8 +260,25 @@
*/
private function loadRepositoryUpdateMessages() {
$type_need_update = PhabricatorRepositoryStatusMessage::TYPE_NEEDS_UPDATE;
- return id(new PhabricatorRepositoryStatusMessage())
- ->loadAllWhere('statusType = %s', $type_need_update);
+ $messages = id(new PhabricatorRepositoryStatusMessage())->loadAllWhere(
+ 'statusType = %s AND id > %d',
+ $type_need_update,
+ $this->statusMessageCursor);
+
+ // Keep track of messages we've seen so that we don't load them again.
+ // If we reload messages, we can get stuck a loop if we have a failing
+ // repository: we update immediately in response to the message, but do
+ // not clear the message because the update does not succeed. We then
+ // immediately retry. Instead, messages are only permitted to trigger
+ // an immediate update once.
+
+ foreach ($messages as $message) {
+ $this->statusMessageCursor = max(
+ $this->statusMessageCursor,
+ $message->getID());
+ }
+
+ return $messages;
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Oct 30, 10:00 AM (3 w, 1 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6723249
Default Alt Text
D11795.diff (1 KB)
Attached To
Mode
D11795: Fix an issue where PullLocal daemon could spin in an error loop
Attached
Detach File
Event Timeline
Log In to Comment