Page MenuHomestyx hydra

No OneTemporary

diff --git a/src/infrastructure/daemon/workers/PhabricatorTaskmasterDaemon.php b/src/infrastructure/daemon/workers/PhabricatorTaskmasterDaemon.php
index 6cbbd8698e..57a69843a4 100644
--- a/src/infrastructure/daemon/workers/PhabricatorTaskmasterDaemon.php
+++ b/src/infrastructure/daemon/workers/PhabricatorTaskmasterDaemon.php
@@ -1,62 +1,65 @@
<?php
final class PhabricatorTaskmasterDaemon extends PhabricatorDaemon {
protected function run() {
do {
PhabricatorCaches::destroyRequestCache();
$tasks = id(new PhabricatorWorkerLeaseQuery())
->setLimit(1)
->execute();
if ($tasks) {
$this->willBeginWork();
foreach ($tasks as $task) {
$id = $task->getID();
$class = $task->getTaskClass();
$this->log(pht('Working on task %d (%s)...', $id, $class));
$task = $task->executeTask();
$ex = $task->getExecutionException();
if ($ex) {
if ($ex instanceof PhabricatorWorkerPermanentFailureException) {
$this->log(
pht(
'Task %d was cancelled: %s',
$id,
$ex->getMessage()));
} else if ($ex instanceof PhabricatorWorkerYieldException) {
$this->log(pht('Task %s yielded.', $id));
} else {
$this->log(pht('Task %d failed!', $id));
throw new PhutilProxyException(
pht('Error while executing Task ID %d.', $id),
$ex);
}
} else {
$this->log(pht('Task %s complete! Moved to archive.', $id));
}
}
$sleep = 0;
} else {
- if ($this->shouldHibernate(60)) {
- break;
+ if ($this->getIdleDuration() > 15) {
+ $hibernate_duration = phutil_units('3 minutes in seconds');
+ if ($this->shouldHibernate($hibernate_duration)) {
+ break;
+ }
}
// When there's no work, sleep for one second. The pool will
// autoscale down if we're continuously idle for an extended period
// of time.
$this->willBeginIdle();
$sleep = 1;
}
$this->sleep($sleep);
} while (!$this->shouldExit());
}
}

File Metadata

Mime Type
text/x-diff
Expires
Fri, Mar 14, 4:16 PM (1 d, 14 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
72027
Default Alt Text
(2 KB)

Event Timeline