Page MenuHomePhabricator

D11437.id27479.diff
No OneTemporary

D11437.id27479.diff

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

Mime Type
text/plain
Expires
Sat, Mar 22, 1:41 AM (13 h, 8 m ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7390510
Default Alt Text
D11437.id27479.diff (1 KB)

Event Timeline