Skip to content

Commit b54c7a7

Browse files
committed
review fixes
1 parent 26f59dd commit b54c7a7

2 files changed

Lines changed: 11 additions & 2 deletions

File tree

server/php-engine.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2424,8 +2424,13 @@ bool check_server_options() {
24242424
const auto& rpc_server_ctx = vk::singleton<RpcServerContext>::get();
24252425
size_t general_workers_cnt = vk::singleton<WorkersControl>::get().get_count(WorkerType::general_worker);
24262426

2427+
if (run_once && (http_server_ctx.server_enabled() || rpc_server_ctx.server_enabled())) {
2428+
kprintf("You can't start RPC or HTTP server in run-once mode\n");
2429+
return false;
2430+
}
2431+
24272432
if (!master_flag && (http_server_ctx.server_enabled() || rpc_server_ctx.server_enabled())) {
2428-
kprintf("Server mode is not supported without workers, yo must specify -f/--workers-num <n>\n");
2433+
kprintf("Server mode is not supported without workers, you must specify -f/--workers-num <n>\n");
24292434
return false;
24302435
}
24312436

server/php-script-run-once-invoker.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,11 @@ void PhpScriptRunOnceInvoker::init(int total_run_once_count) {
4141
}
4242

4343
rpc_client_methods.rpc_ready = nullptr;
44-
epoll_insert_pipe(pipe_for_read, read_fd, &ct_php_rpc_client, &rpc_client_methods);
44+
auto* connection = epoll_insert_pipe(pipe_for_read, read_fd, &ct_php_rpc_client, &rpc_client_methods);
45+
if (connection == nullptr) {
46+
kprintf("Failed to insert pipe to epoll reactor\n");
47+
exit(1);
48+
}
4549
}
4650

4751
bool PhpScriptRunOnceInvoker::invoke_run_once(int runs_count) {

0 commit comments

Comments
 (0)