Skip to content

Commit

Permalink
Debug received statuses
Browse files Browse the repository at this point in the history
  • Loading branch information
driv3r committed Oct 9, 2023
1 parent b89b70a commit 9822b6e
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions test/helpers/ghostferry_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -174,17 +174,21 @@ def start_server

query = CGI::parse(req.body)

statuses = query["status"]
data = query["data"]
statuses = Array(query["status"])

unless statuses
if statuses.empty?
@server_last_error = ArgumentError.new("Ghostferry is improperly implemented and did not send a status")
resp.status = 400
@server.shutdown
elsif statuses.size > 1
@logger.warn("Got multiple statuses at once: #{statuses.inspect}")
puts "Got multiple statuses at once: #{statuses.inspect}"
end

@last_message_time = now

data = query["data"]

statuses.each do |status|
next if @status_handlers[status].nil?

Expand Down

0 comments on commit 9822b6e

Please sign in to comment.