Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F13958132
D11808.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
D11808.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
@@ -77,7 +77,7 @@
// If any repositories have the NEEDS_UPDATE flag set, pull them
// as soon as possible.
- $need_update_messages = $this->loadRepositoryUpdateMessages();
+ $need_update_messages = $this->loadRepositoryUpdateMessages(true);
foreach ($need_update_messages as $message) {
$repo = idx($pullable, $message->getRepositoryID());
if (!$repo) {
@@ -256,9 +256,18 @@
/**
+ * Check for repositories that should be updated immediately.
+ *
+ * With the `$consume` flag, an internal cursor will also be incremented so
+ * that these messages are not returned by subsequent calls.
+ *
+ * @param bool Pass `true` to consume these messages, so the process will
+ * not see them again.
+ * @return list<wild> Pending update messages.
+ *
* @task pull
*/
- private function loadRepositoryUpdateMessages() {
+ private function loadRepositoryUpdateMessages($consume = false) {
$type_need_update = PhabricatorRepositoryStatusMessage::TYPE_NEEDS_UPDATE;
$messages = id(new PhabricatorRepositoryStatusMessage())->loadAllWhere(
'statusType = %s AND id > %d',
@@ -272,10 +281,12 @@
// immediately retry. Instead, messages are only permitted to trigger
// an immediate update once.
- foreach ($messages as $message) {
- $this->statusMessageCursor = max(
- $this->statusMessageCursor,
- $message->getID());
+ if ($consume) {
+ foreach ($messages as $message) {
+ $this->statusMessageCursor = max(
+ $this->statusMessageCursor,
+ $message->getID());
+ }
}
return $messages;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Oct 15, 1:06 PM (4 w, 13 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6712930
Default Alt Text
D11808.diff (1 KB)
Attached To
Mode
D11808: Only increment status message cursor if we're going to consume the message
Attached
Detach File
Event Timeline
Log In to Comment