ktamas77 / firebase-php

Firebase PHP Client
792 stars 215 forks source link

SET Data fails fot large amount of data in case of single $firebase object #55

Open barbax opened 8 years ago

barbax commented 8 years ago

We are testing $firebase->set() for a large amount of data. The scenario could be replicated in php with this snippet:

$firebase = new \Firebase\FirebaseLib(DEFAULT_URL, DEFAULT_TOKEN); foreach($bigamountofdata as $data){ $firebase->set($my_url, $data); }

When the amount of data is very big and cycle iterate after some seconds the $firebase->set() will fail. It will return a 502 Bad Gateway response in the firt place and then CURL will stop working with this error: Call to URLFetch failed with application error 1 (URL using bad/illegal format or missing URL) for url MY_URL.

To fix this we edited our code this way:

foreach($bigamountofdata as $data){ $firebase = new \Firebase\FirebaseLib(DEFAULT_URL, DEFAULT_TOKEN); $firebase->set($my_url, $data); }

Is this the expected behaviour?