panthomakos / timezone

Accurate current and historical timezones for Ruby with support for Geonames and Google latitude - longitude lookups.
http://rubygems.org/gems/timezone
MIT License
354 stars 49 forks source link

[Fix #71] Make lookups thread-safe #72

Closed panthomakos closed 7 years ago

panthomakos commented 7 years ago

Net::HTTP, in Ruby's standard library, is not threadsafe. The issue is easy to sidestep by creating a new Net::HTTP object for every lookup. The overhead of creating a new object compared to the network lookup call is trivial.