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
|
||||
{
|
||||
$app = Snowflake::app()->increment();
|
||||
Coroutine\defer(function () use ($app) {
|
||||
$app->decrement();
|
||||
});
|
||||
|
||||
$time = microtime(TRUE);
|
||||
if (empty($data)) {
|
||||
return $server->finish('null data');
|
||||
@@ -73,6 +78,11 @@ class OnTask extends Callback
|
||||
*/
|
||||
public function onContinueTask(Server $server, Server\Task $task): mixed
|
||||
{
|
||||
$app = Snowflake::app()->increment();
|
||||
Coroutine\defer(function () use ($app) {
|
||||
$app->decrement();
|
||||
});
|
||||
|
||||
$time = microtime(TRUE);
|
||||
if (empty($task->data)) {
|
||||
return $task->finish('null data');
|
||||
|
||||
Reference in New Issue
Block a user