Skip to content

Commit

Permalink
Optimize code for setting heartbeat_idle_time
Browse files Browse the repository at this point in the history
  • Loading branch information
matyhtf committed May 26, 2021
1 parent e4caad2 commit 4eed1a6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ext-src/swoole_server.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2390,7 +2390,8 @@ static PHP_METHOD(swoole_server, set) {
php_swoole_fatal_error(E_WARNING, "heartbeat_idle_time must be greater than heartbeat_check_interval");
serv->heartbeat_check_interval = serv->heartbeat_idle_time / 2;
}
} else if (serv->heartbeat_check_interval > 0) {
}
if (serv->heartbeat_idle_time == 0 && serv->heartbeat_check_interval > 0) {
serv->heartbeat_idle_time = serv->heartbeat_check_interval * 2;
}
// max_request
Expand Down

0 comments on commit 4eed1a6

Please sign in to comment.