Skip to content

Commit

Permalink
fix: fix bug in smtp server when exceptions occur
Browse files Browse the repository at this point in the history
  • Loading branch information
adamcooke committed Mar 4, 2024
1 parent dbd0e27 commit 9dd00f6
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions app/lib/smtp_server/server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,7 @@ def run_event_loop
logger.error line
end
increment_prometheus_counter :postal_smtp_server_exceptions_total,
error: e.class.to_s,
type: "client-accept"
labels: { error: e.class.to_s, type: "client-accept" }
begin
new_io.close
rescue StandardError
Expand Down Expand Up @@ -260,8 +259,7 @@ def run_event_loop
end

increment_prometheus_counter :postal_smtp_server_exceptions_total,
error: e.class.to_s,
type: "data"
labels: { error: e.class.to_s, type: "data" }

# Close all IO and forget this client
begin
Expand Down

0 comments on commit 9dd00f6

Please sign in to comment.