Permalink
Browse files

Allow direct access based on FLYING_SPHINX_INGRESS

  • Loading branch information...
1 parent c1864f1 commit b13ee8aafbedf9822a77dd8608f2e3a14d077a07 @pat pat committed Feb 14, 2012
Showing with 5 additions and 4 deletions.
  1. +5 −4 lib/flying_sphinx/tunnel.rb
@@ -7,11 +7,12 @@ def self.connect(configuration, &block)
end
end
end
-
+
def self.required?
+ ENV['FLYING_SPHINX_INGRESS'].blank? &&
ThinkingSphinx.database_adapter == FlyingSphinx::HerokuSharedAdapter
end
-
+
def initialize(configuration)
@configuration = configuration
end
@@ -23,13 +24,13 @@ def open(&block)
)
session.loop { !remote_exists?(session) }
-
+
yield session
rescue IOError
# Server closed the connection on us. That's (hopefully) expected, nothing
# to worry about.
end
-
+
private
def db_host

0 comments on commit b13ee8a

Please sign in to comment.