Skip to content

Commit

Permalink
gc
Browse files Browse the repository at this point in the history
  • Loading branch information
asika32764 committed Nov 27, 2024
1 parent 35fa754 commit 9295f20
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/reactor/resources/servers/swoole_website.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,8 @@

$server->onRequest(function (RequestEvent $event) use ($app) {
$app->runCliServerRequest($event);

CliServerRuntime::gc();
});

/*
Expand All @@ -143,6 +145,8 @@
CliServerRuntime::logLine('Start listening: http://localhost:' . $serv->port);
CliServerRuntime::logLine('<fg=yellow>Press Ctrl+C to stop the server</>');
CliServerRuntime::logNewLine(1);

CliServerRuntime::gc();
});

/*
Expand Down
8 changes: 8 additions & 0 deletions packages/reactor/resources/servers/swoole_websocket.php
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,8 @@ function (OpenEvent $event) use ($app) {
} catch (\Throwable $e) {
CliServerRuntime::handleThrowable($e);
}

CliServerRuntime::gc();
}
);

Expand All @@ -181,6 +183,8 @@ function (MessageEvent $event) use ($app) {
} catch (\Throwable $e) {
CliServerRuntime::handleThrowable($e);
}

CliServerRuntime::gc();
}
);

Expand All @@ -204,6 +208,8 @@ function (CloseEvent $event) use ($app) {
} catch (\Throwable $e) {
CliServerRuntime::handleThrowable($e);
}

CliServerRuntime::gc();
}
);

Expand All @@ -230,6 +236,8 @@ function (StartEvent $event) use ($server, $app) {
CliServerRuntime::handleThrowable($e);
$server->shutdown();
}

CliServerRuntime::gc();
}
);

Expand Down

0 comments on commit 9295f20

Please sign in to comment.