改名
This commit is contained in:
+12
-1
@@ -7,6 +7,7 @@ namespace Database;
|
|||||||
use Snowflake\Abstracts\Component;
|
use Snowflake\Abstracts\Component;
|
||||||
use Closure;
|
use Closure;
|
||||||
use Exception;
|
use Exception;
|
||||||
|
use Snowflake\Event;
|
||||||
use Snowflake\Snowflake;
|
use Snowflake\Snowflake;
|
||||||
use Swoole\Coroutine;
|
use Swoole\Coroutine;
|
||||||
|
|
||||||
@@ -179,9 +180,19 @@ class Pagination extends Component
|
|||||||
{
|
{
|
||||||
$this->_group->add(1);
|
$this->_group->add(1);
|
||||||
return Coroutine::create(function ($callback, $data, $param) {
|
return Coroutine::create(function ($callback, $data, $param) {
|
||||||
|
try {
|
||||||
call_user_func($callback, $data, $param);
|
call_user_func($callback, $data, $param);
|
||||||
|
} catch (\Throwable $exception) {
|
||||||
|
$this->addError($exception->getMessage());
|
||||||
|
} finally {
|
||||||
$this->_group->done();
|
$this->_group->done();
|
||||||
},$callback, $data, $param);
|
$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