Created
January 13, 2014 22:10
-
-
Save washu/8409115 to your computer and use it in GitHub Desktop.
This file contains 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
Rails.logger.info "Starting Reaper #{@frequency} #{@pool}" | |
Thread.new(@frequency, @pool) do |t, p| | |
begin | |
loop do | |
begin | |
sleep t | |
Rails.logger.info "Reaping ...." | |
p.reap | |
rescue | |
Rails.logger.info "Error during reaping #{$!}" | |
end | |
end | |
ensure | |
Rails.logger.info "Exiting Reaper Thread" | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment