Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Update transaction.rb #64

Merged
merged 1 commit into from

2 participants

@todd-richmond

Do not lookup results of gethostname() in DNS as it often does not exist - either because it is a desktop or the external name is different. This can cause a fairly considerable delay in startup (the longest single Gem delay in our large Sinatra application found through file load instrumentation) which is quite noticeable during development or test automation

Todd Richmond Update transaction.rb
Do not lookup results of gethostname() in DNS as it often does not exist - either because it is a desktop or the external name is different
29d0c7a
@dbussink dbussink merged commit 6fe1b47 into datamapper:master
@dbussink
Owner

Released in 0.10.14

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Feb 6, 2014
  1. Update transaction.rb

    Todd Richmond authored
    Do not lookup results of gethostname() in DNS as it often does not exist - either because it is a desktop or the external name is different
This page is out of date. Refresh to see the latest.
Showing with 2 additions and 2 deletions.
  1. +2 −2 data_objects/lib/data_objects/transaction.rb
View
4 data_objects/lib/data_objects/transaction.rb
@@ -6,8 +6,8 @@ module DataObjects
class Transaction
- # The host name. Note, this relies on the host name being configured and resolvable using DNS
- HOST = "#{Socket::gethostbyname(Socket::gethostname)[0]}" rescue "localhost"
+ # The local host name. Do not attempt to resolve in DNS to prevent potentially long delay
+ HOST = "#{Socket::gethostname}" rescue "localhost"
@@counter = 0
# The connection object allocated for this transaction
Something went wrong with that request. Please try again.