Page MenuHomePhabricator

D17553.diff
No OneTemporary

D17553.diff

diff --git a/src/daemon/PhutilDaemonHandle.php b/src/daemon/PhutilDaemonHandle.php
--- a/src/daemon/PhutilDaemonHandle.php
+++ b/src/daemon/PhutilDaemonHandle.php
@@ -24,6 +24,7 @@
private $shouldRestart = true;
private $shouldShutdown;
private $hibernating = false;
+ private $shouldSendExitEvent = false;
private function __construct() {
// <empty>
@@ -90,6 +91,7 @@
public function didLaunch() {
$this->restartAt = time();
+ $this->shouldSendExitEvent = true;
$this->dispatchEvent(
self::EVENT_DID_LAUNCH,
@@ -184,7 +186,6 @@
if ($this->shouldShutdown) {
$this->restartAt = null;
- $this->dispatchEvent(self::EVENT_WILL_EXIT);
} else {
$this->scheduleRestart();
}
@@ -500,5 +501,13 @@
);
}
+ public function didExit() {
+ if ($this->shouldSendExitEvent) {
+ $this->dispatchEvent(self::EVENT_WILL_EXIT);
+ $this->shouldSendExitEvent = false;
+ }
+
+ return $this;
+ }
}
diff --git a/src/daemon/PhutilDaemonPool.php b/src/daemon/PhutilDaemonPool.php
--- a/src/daemon/PhutilDaemonPool.php
+++ b/src/daemon/PhutilDaemonPool.php
@@ -185,6 +185,8 @@
$daemon->update();
if ($daemon->isDone()) {
+ $daemon->didExit();
+
unset($this->daemons[$key]);
$this->logMessage(

File Metadata

Mime Type
text/plain
Expires
Fri, Mar 7, 10:15 PM (3 w, 3 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7352503
Default Alt Text
D17553.diff (1 KB)

Event Timeline