改名
This commit is contained in:
+14
-3
@@ -7,6 +7,7 @@ namespace Database;
|
||||
use Snowflake\Abstracts\Component;
|
||||
use Closure;
|
||||
use Exception;
|
||||
use Snowflake\Event;
|
||||
use Snowflake\Snowflake;
|
||||
use Swoole\Coroutine;
|
||||
|
||||
@@ -179,9 +180,19 @@ class Pagination extends Component
|
||||
{
|
||||
$this->_group->add(1);
|
||||
return Coroutine::create(function ($callback, $data, $param) {
|
||||
call_user_func($callback, $data, $param);
|
||||
$this->_group->done();
|
||||
},$callback, $data, $param);
|
||||
try {
|
||||
call_user_func($callback, $data, $param);
|
||||
} catch (\Throwable $exception) {
|
||||
$this->addError($exception->getMessage());
|
||||
} finally {
|
||||
$this->_group->done();
|
||||
$event = Snowflake::app()->getEvent();
|
||||
if (!$event->exists(Event::EVENT_AFTER_REQUEST)) {
|
||||
return;
|
||||
}
|
||||
$event->trigger(Event::EVENT_AFTER_REQUEST);
|
||||
}
|
||||
}, $callback, $data, $param);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user