mirror of
https://github.com/itzg/docker-minecraft-server.git
synced 2026-07-03 23:44:16 +00:00
Add AUTOPAUSE_STATUS_RETRY_LIMIT and AUTOPAUSE_STATUS_RETRY_INTERVAL (#3365)
This commit is contained in:
@@ -37,7 +37,12 @@ mc_server_listening() {
|
||||
java_clients_connections() {
|
||||
local connections
|
||||
if java_running; then
|
||||
if ! connections=$(mc-monitor status $(use_proxy) --host "${SERVER_HOST:-localhost}" --port "$SERVER_PORT" $(use_server_list_ping) --show-player-count); then
|
||||
if ! connections=$(mc-monitor status \
|
||||
--host "${SERVER_HOST:-localhost}" \
|
||||
--port "$SERVER_PORT" \
|
||||
--retry-limit "${AUTOPAUSE_STATUS_RETRY_LIMIT:-10}" --retry-interval "${AUTOPAUSE_STATUS_RETRY_INTERVAL:-2s}" \
|
||||
$(use_proxy) $(use_server_list_ping) \
|
||||
--show-player-count); then
|
||||
# consider it a non-zero player count if the ping fails
|
||||
# otherwise a laggy server with players connected could get paused
|
||||
connections=1
|
||||
|
||||
Reference in New Issue
Block a user