Skip to content

Instantly share code, notes, and snippets.

@washu
Created January 13, 2014 22:10
Show Gist options
  • Save washu/8409115 to your computer and use it in GitHub Desktop.
Save washu/8409115 to your computer and use it in GitHub Desktop.
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