DaemonDb: emit 'connecting', fix event name

This commit is contained in:
Thomas Gelf 2019-10-12 17:29:52 +02:00
parent f9c1326427
commit 2c000d4160

View File

@ -107,7 +107,7 @@ class DaemonDb
} else {
Logger::error('DB configuration is no longer valid');
}
$this->emitStatus('there is no valid DB configuration');
$this->emitStatus('no configuration');
$this->dbConfig = $config;
return new FulfilledPromise();
@ -136,6 +136,7 @@ class DaemonDb
$this->pendingReconnection->reset();
$this->pendingReconnection = null;
}
$this->emitStatus('connecting');
return $this->pendingReconnection = RetryUnless::succeeding($callback)
->setInterval(0.2)
@ -286,7 +287,7 @@ class DaemonDb
protected function emitStatus($message, $level = 'info')
{
$this->emit('status', [$message, $level]);
$this->emit('state', [$message, $level]);
return $this;
}