modify
This commit is contained in:
@@ -48,6 +48,11 @@ class OnTask extends Callback
|
|||||||
*/
|
*/
|
||||||
public function onTask(Server $server, int $task_id, int $from_id, string $data): mixed
|
public function onTask(Server $server, int $task_id, int $from_id, string $data): mixed
|
||||||
{
|
{
|
||||||
|
$app = Snowflake::app()->increment();
|
||||||
|
Coroutine\defer(function () use ($app) {
|
||||||
|
$app->decrement();
|
||||||
|
});
|
||||||
|
|
||||||
$time = microtime(TRUE);
|
$time = microtime(TRUE);
|
||||||
if (empty($data)) {
|
if (empty($data)) {
|
||||||
return $server->finish('null data');
|
return $server->finish('null data');
|
||||||
@@ -73,6 +78,11 @@ class OnTask extends Callback
|
|||||||
*/
|
*/
|
||||||
public function onContinueTask(Server $server, Server\Task $task): mixed
|
public function onContinueTask(Server $server, Server\Task $task): mixed
|
||||||
{
|
{
|
||||||
|
$app = Snowflake::app()->increment();
|
||||||
|
Coroutine\defer(function () use ($app) {
|
||||||
|
$app->decrement();
|
||||||
|
});
|
||||||
|
|
||||||
$time = microtime(TRUE);
|
$time = microtime(TRUE);
|
||||||
if (empty($task->data)) {
|
if (empty($task->data)) {
|
||||||
return $task->finish('null data');
|
return $task->finish('null data');
|
||||||
|
|||||||
Reference in New Issue
Block a user