diff options
author | Lamont Granquist <lamont@scriptkiddie.org> | 2016-07-29 16:04:59 -0700 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2016-08-09 09:17:52 -0700 |
commit | 0cd3117c34bfb89e5e39c5c80bb661a3bafb9959 (patch) | |
tree | 0e2d7927b1f1e0e5283e35054a3e2027c8400d00 | |
parent | beaf78be8b4141db45e33aa43e45b20fdb60b7a2 (diff) | |
download | chef-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.rb | 2 |
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 |