Changeset View
Changeset View
Standalone View
Standalone View
src/daemon/PhutilDaemon.php
Show First 20 Lines • Show All 133 Lines • ▼ Show 20 Lines | final protected function shouldHibernate($duration) { | ||||
// Never hibernate if we're part of a pool and could scale down instead. | // Never hibernate if we're part of a pool and could scale down instead. | ||||
// We only hibernate the last process to drop the pool size to zero. | // We only hibernate the last process to drop the pool size to zero. | ||||
if ($this->getScaledownDuration()) { | if ($this->getScaledownDuration()) { | ||||
return false; | return false; | ||||
} | } | ||||
// Don't hibernate for too long. | // Don't hibernate for too long. | ||||
$duration = max($duration, phutil_units('3 minutes in seconds')); | $duration = min($duration, phutil_units('3 minutes in seconds')); | ||||
$this->emitOverseerMessage( | $this->emitOverseerMessage( | ||||
self::MESSAGETYPE_HIBERNATE, | self::MESSAGETYPE_HIBERNATE, | ||||
array( | array( | ||||
'duration' => $duration, | 'duration' => $duration, | ||||
)); | )); | ||||
$this->log( | $this->log( | ||||
▲ Show 20 Lines • Show All 233 Lines • Show Last 20 Lines |