Last active
January 24, 2017 17:38
-
-
Save matthieuprat/8fca198b99cc8aaa28e72c955b8e0702 to your computer and use it in GitHub Desktop.
Patch for puma reactor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- 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