This commit is contained in:
2021-08-13 14:58:58 +08:00
parent 15851ba97c
commit 2432b98be5
13 changed files with 90 additions and 151 deletions
+6 -3
View File
@@ -6,7 +6,9 @@ namespace Annotation;
use Exception;
use Kiri\Event;
use Kiri\Events\EventProvider;
use Kiri\Kiri;
use Server\Events\OnWorkerExit;
/**
* Class LocalService
@@ -28,9 +30,10 @@ use Kiri\Kiri;
if ($this->async_reload !== true) {
return;
}
Event::on(Event::SERVER_WORKER_EXIT, function () {
Kiri::app()->remove($this->service);
});
$pro = di(EventProvider::class);
$pro->on(OnWorkerExit::class, function () {
di(\Kiri\Di\LocalService::class)->remove($this->service);
},0);
}