Commit 673cb9b5 authored by Maik Messerschmidt's avatar Maik Messerschmidt
Browse files

Use chunk() instead of cursor(). #1

parent 6139b931
......@@ -165,9 +165,11 @@ class ResultController extends Controller
$zip = new ZipStream('results.zip', $options);
Result::cursor()->each(function($result) use ($zip) {
$filename = $result->created_at . ".json";
$zip->addFile($filename, $result->getOriginal("data"));
Result::chunk(5, function($results) use ($zip) {
foreach ($results as $result) {
$filename = $result->created_at . ".json";
$zip->addFile($filename, $result->getOriginal("data"));
}
});
$zip->finish();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment