1
0
Fork 0
mirror of https://github.com/capistrano/capistrano synced 2023-03-27 23:21:18 -04:00

Make sure the connection factory is instantiated synchronously

git-svn-id: http://svn.rubyonrails.org/rails/tools/capistrano@7039 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
Jamis Buck 2007-06-16 21:16:05 +00:00
parent b749367464
commit c041a2d968
2 changed files with 7 additions and 1 deletions

View file

@ -1,5 +1,7 @@
*SVN*
* Make sure the connection factory is established synchronously, to avoid multiple gateway instances being spawned [Jamis Buck]
* Make sure symlink and finalize_update tasks reference the most recent release when called by themselves [Jamis Buck]

View file

@ -91,8 +91,12 @@ module Capistrano
# prevents problems with the thread's scope seeing the wrong 'server'
# variable if the thread just happens to take too long to start up.
def establish_connection_to(server)
# force the connection factory to be instantiated synchronously,
# otherwise we wind up with multiple gateway instances, because
# each connection is done in parallel.
connection_factory
Thread.new { sessions[server] ||= connection_factory.connect_to(server) }
end
end
end
end
end