Closed nitsujri closed 3 years ago
This is a great find. Will merge it in and get a release done.
There were a few changes in master prior to this pull request which added Lamby handling ad-hoc events for EventBridge. As such, there could be simple IO objects returned vs Rack's. This cased a IOError test failure and my fix in https://github.com/customink/lamby/commit/0ba6fb063f8fac15859c9ac2cf28875b72e1aac2 is illustrated to behave below.
StringIO.new('sdfsaf').each { |part| part }.tap{ |x| x.close }
=> #<StringIO:0x00007f9bf4bb6010>
StringIO.new('sdfsaf').tap{ |x| x.close }.each { |part| part }
IOError: not opened for reading
Please let me know if you see any issue with that commit and moving the close method around.
Just pushed v2.8.0 to rubygems
Yep this works great! Thanks for that.
Description
Solves https://github.com/customink/lamby/issues/84.
Handlers for Webrick and cgi all perform a
.close
as part of their lifecycle. A key function in the close hook isclear_query_cache
.We need to do the same.
Notes
Without this, one specific problem is ActiveRecord query_cache does not get cleared between requests easily causing stale data to be served back to clients.