Skip to content

Commit

Permalink
Fix ameba issues
Browse files Browse the repository at this point in the history
  • Loading branch information
zw963 committed Nov 13, 2024
1 parent cdba486 commit 5aff8d5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
3 changes: 3 additions & 0 deletions .ameba.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,6 @@ Metrics/CyclomaticComplexity:

Naming/BlockParameterName:
Enabled: false

Naming/AccessorMethodName:
Enabled: false
2 changes: 1 addition & 1 deletion src/procodile/core_ext/process.cr
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
class ::Process
# override ::Process.fork in stdlib for suppress the warning message.
def self.fork(&block) : Process
def self.fork(&) : Process
new Crystal::System::Process.fork { yield }
end
end
6 changes: 3 additions & 3 deletions src/procodile/tcp_proxy.cr
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,9 @@ module Procodile
end
readers = {:backend => backend_socket, :client => client}
loop do
io = IO.select(readers.values, nil, nil, 0.5)
if io && io.first
io.first.each do |io|
ios = IO.select(readers.values, nil, nil, 0.5)
if ios && ios.first
ios.first.each do |io|
readers.keys.each do |key|
next unless readers[key] == io
opposite_side = key == :client ? :backend : :client
Expand Down

0 comments on commit 5aff8d5

Please sign in to comment.