Skip to content

Commit

Permalink
Allow --term-timout 0, -1 means infinite
Browse files Browse the repository at this point in the history
  • Loading branch information
carlhoerberg committed May 6, 2024
1 parent e2cd981 commit 070e0e1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/amqproxy.cr
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class AMQProxy::CLI
@listen_port = ENV["LISTEN_PORT"]? || 5673
@log_level : Log::Severity = Log::Severity::Info
@idle_connection_timeout : Int32 = ENV.fetch("IDLE_CONNECTION_TIMEOUT", "5").to_i
@term_timeout = 0
@term_timeout = -1
@upstream = ENV["AMQP_URL"]?

def parse_config(path) # ameba:disable Metrics/CyclomaticComplexity
Expand Down Expand Up @@ -91,7 +91,7 @@ class AMQProxy::CLI
first_shutdown = false
server.stop_accepting_clients
server.disconnect_clients
if @term_timeout > 0
if @term_timeout >= 0
spawn do
sleep @term_timeout
abort "Exiting with #{server.client_connections} client connections still open"
Expand Down

0 comments on commit 070e0e1

Please sign in to comment.