This commit is contained in:
2020-09-07 15:54:53 +08:00
parent c71376e6e4
commit 6493fc9450
2 changed files with 4 additions and 2 deletions
+2 -1
View File
@@ -15,6 +15,7 @@ use Snowflake\Event;
use Snowflake\Exception\ComponentException;
use Snowflake\Exception\ConfigException;
use Snowflake\Snowflake;
use Swoole\Coroutine;
use Swoole\Server;
use Closure;
@@ -32,7 +33,7 @@ class OnShutdown extends Callback
*/
public function onHandler(Server $server)
{
$this->system_mail('server shutdown~');
Coroutine::create([$this,'system_mail'],'server shutdown~');
$event = Snowflake::app()->getEvent();
if (!$event->exists(Event::SERVER_SHUTDOWN)) {
return;