Changeset View
Changeset View
Standalone View
Standalone View
src/daemon/PhutilDaemon.php
| Show First 20 Lines • Show All 143 Lines • ▼ Show 20 Lines | while ($duration > 0 && | ||||
| // DOWN message tells the overseer that we don't want to be restarted. | // DOWN message tells the overseer that we don't want to be restarted. | ||||
| if ($is_autoscale) { | if ($is_autoscale) { | ||||
| if ($this->workState == self::WORKSTATE_IDLE) { | if ($this->workState == self::WORKSTATE_IDLE) { | ||||
| if ($this->idleSince && ($this->idleSince + $scale_down < time())) { | if ($this->idleSince && ($this->idleSince + $scale_down < time())) { | ||||
| $this->inGracefulShutdown = true; | $this->inGracefulShutdown = true; | ||||
| $this->emitOverseerMessage(self::MESSAGETYPE_DOWN, null); | $this->emitOverseerMessage(self::MESSAGETYPE_DOWN, null); | ||||
| $this->log( | $this->log( | ||||
| pht( | pht( | ||||
| 'Daemon was idle for more than %s seconds, scaling pool '. | 'Daemon was idle for more than %s second(s), '. | ||||
| 'down.', | 'scaling pool down.', | ||||
| $scale_down)); | new PhutilNumber($scale_down))); | ||||
| break; | break; | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| sleep(min($duration, $max_sleep)); | sleep(min($duration, $max_sleep)); | ||||
| $duration -= $max_sleep; | $duration -= $max_sleep; | ||||
| $this->stillWorking(); | $this->stillWorking(); | ||||
| ▲ Show 20 Lines • Show All 234 Lines • Show Last 20 Lines | |||||