summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2016-07-29 16:04:59 -0700
committerLamont Granquist <lamont@scriptkiddie.org>2016-08-09 09:17:52 -0700
commit0cd3117c34bfb89e5e39c5c80bb661a3bafb9959 (patch)
tree0e2d7927b1f1e0e5283e35054a3e2027c8400d00
parentbeaf78be8b4141db45e33aa43e45b20fdb60b7a2 (diff)
downloadchef-0cd3117c34bfb89e5e39c5c80bb661a3bafb9959.tar.gz
stop constantly using new ServerAPI objects
keep one-per-thread though since i doubt we're threadsafe
-rw-r--r--lib/chef/cookbook/synchronizer.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/chef/cookbook/synchronizer.rb b/lib/chef/cookbook/synchronizer.rb
index 1ee30bacc7..60be422c66 100644
--- a/lib/chef/cookbook/synchronizer.rb
+++ b/lib/chef/cookbook/synchronizer.rb
@@ -291,7 +291,7 @@ class Chef
end
def server_api
- Chef::ServerAPI.new(Chef::Config[:chef_server_url])
+ Thread.current[:server_api] ||= Chef::ServerAPI.new(Chef::Config[:chef_server_url])
end
end