File tree Expand file tree Collapse file tree
lib/OpenCloud/LoadBalancer/Resource Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -255,17 +255,20 @@ public function addNodes()
255255 );
256256 }
257257
258- $ requests = array ();
258+ $ requestData = array (' nodes ' => array () );
259259
260+ /** @var Node $node */
260261 foreach ($ this ->nodes as $ node ) {
261262 // Only add the node if it is new
262263 if (null === $ node ->getId ()) {
263- $ json = json_encode ( $ node ->createJson () );
264- $ requests [] = $ this -> getClient ()-> post ( $ node -> getUrl (), self :: getJsonHeader (), $ json ) ;
264+ $ nodeJson = $ node ->createJson ();
265+ $ requestData [ ' nodes ' ][] = $ nodeJson [ ' nodes ' ][ 0 ] ;
265266 }
266267 }
267268
268- return $ this ->getClient ()->send ($ requests );
269+ $ request = $ this ->getClient ()->post ($ node ->getUrl (), self ::getJsonHeader (), json_encode ($ requestData ));
270+
271+ return $ this ->getClient ()->send ($ request );
269272 }
270273
271274 /**
You can’t perform that action at this time.
0 commit comments