Skip to content

Instantly share code, notes, and snippets.

@matthieuprat
Last active January 24, 2017 17:38
Show Gist options
  • Save matthieuprat/8fca198b99cc8aaa28e72c955b8e0702 to your computer and use it in GitHub Desktop.
Save matthieuprat/8fca198b99cc8aaa28e72c955b8e0702 to your computer and use it in GitHub Desktop.
Patch for puma reactor
--- reactor.rb
+++ reactor.rb
@@ -165,16 +165,18 @@
def calculate_sleep
if @timeouts.empty?
@sleep_for = DefaultSleepFor
else
diff = @timeouts.first.timeout_at.to_f - Time.now.to_f
if diff < 0.0
@sleep_for = 0
+ elsif diff > 30.0
+ @sleep_for = 30
else
@sleep_for = diff
end
end
end
def add(c)
@mutex.synchronize do
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment