|
@@ -51,8 +51,10 @@ class TestCommand extends Command
|
|
|
|
|
|
public function search()
|
|
|
{
|
|
|
- Goods::get()->map(function (Goods $g) {
|
|
|
- app(GoodsService::class)->createIndex($g);
|
|
|
+ Goods::chunk(100, function ($goods) {
|
|
|
+ $goods->each(function (Goods $g) {
|
|
|
+ app(GoodsService::class)->createIndex($g);
|
|
|
+ });
|
|
|
});
|
|
|
}
|
|
|
}
|