kangguru / rack-google-analytics

Simple Rack middleware for implementing google analytics tracking in your Ruby-Rack based project. Supports synchronous and asynchronous insertion and configurable load options
MIT License
257 stars 53 forks source link

Ensure the body is closed after iterating over it #11

Closed rymai closed 12 years ago

rymai commented 12 years ago

Hi,

I was getting many (deadlock; recursive locking) errors on my Heroku app in production environment and not in staging and couldn't find the origin until if found this thread and then this post.

Then I compared the Rack middleware of the staging and production environments and found that the only Rack middleware that was present in production and not in staging was this one! And in fact, it appeared that you didn't close the body after iterating over it so I fixed this and since then I didn't get any new (deadlock; recursive locking) errors. :)

I've also improved the overall gem architecture:

I hope you like these changes, otherwise feel free to ignore them and merge only the fix in the first commit.

Thanks!

leehambley commented 12 years ago

Rymal, thanks for the comprehensive fixes, I'll make a note to pull these and ship a new release to Rubygems soon! (A little busy starting my own company right now)

rymai commented 12 years ago

No problem, take your time!

Thanks very much! :)

leehambley commented 12 years ago

https://rubygems.org/gems/rack-google-analytics

rymai commented 12 years ago

Awesome, thanks very much!

leehambley commented 12 years ago

Thank you indeed for the patch @rymai !