This commit is contained in:
as2252258@163.com
2021-04-23 03:25:03 +08:00
parent 0c5e05b6a2
commit a5a607495f
11 changed files with 261 additions and 248 deletions
+18 -14
View File
@@ -18,19 +18,23 @@ class OnFinish extends Callback
{
/**
* @param Server $server
* @param $task_id
* @param $data
* @throws Exception
*/
public function onHandler(Server $server, $task_id, $data)
{
try {
fire(Event::TASK_FINISH, [$task_id, $data]);
} catch (\Throwable $exception) {
$this->addError($exception, 'task');
}
}
/**
* @param Server $server
* @param $task_id
* @param $data
* @throws Exception
*/
public function onHandler(Server $server, $task_id, $data)
{
try {
defer(function () {
fire(Event::SYSTEM_RESOURCE_RELEASES);
logger_insert();
});
fire(Event::TASK_FINISH, [$task_id, $data]);
} catch (\Throwable $exception) {
$this->addError($exception, 'task');
}
}
}