Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15401006
D11437.id27488.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
D11437.id27488.diff
View Options
diff --git a/src/infrastructure/daemon/workers/storage/PhabricatorWorkerTrigger.php b/src/infrastructure/daemon/workers/storage/PhabricatorWorkerTrigger.php
--- a/src/infrastructure/daemon/workers/storage/PhabricatorWorkerTrigger.php
+++ b/src/infrastructure/daemon/workers/storage/PhabricatorWorkerTrigger.php
@@ -130,6 +130,26 @@
}
+ /**
+ * Predict the epoch at which this trigger will next fire.
+ *
+ * @return int|null Epoch when the event will next fire, or `null` if it is
+ * not planned to trigger.
+ */
+ public function getNextEventPrediction() {
+ // NOTE: We're basically echoing the database state here, so this won't
+ // necessarily be accurate if the caller just updated the object but has
+ // not saved it yet. That's a weird use case and would require more
+ // gymnastics, so don't bother trying to get it totally correct for now.
+
+ if ($this->getEvent()) {
+ return $this->getEvent()->getNextEpoch();
+ } else {
+ return $this->getNextEventEpoch(null, $is_reschedule = false);
+ }
+ }
+
+
/* -( PhabricatorDestructibleInterface )----------------------------------- */
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Mar 18, 3:11 PM (3 d, 23 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7390510
Default Alt Text
D11437.id27488.diff (1 KB)
Attached To
Mode
D11437: Add a call to predict the next event for a trigger
Attached
Detach File
Event Timeline
Log In to Comment