This commit is contained in:
2023-12-21 22:13:18 +03:00
parent a6f51d94a0
commit 85a42dc405
2 changed files with 7 additions and 1 deletions

View File

@ -34,7 +34,7 @@ var platiCommand = &cli.Command{
// printNames(categories)
wg, _ := errgroup.WithContext(ctx)
wg.SetLimit(30)
wg.SetLimit(10)
for i, c := range categories {
l := i
@ -48,6 +48,8 @@ var platiCommand = &cli.Command{
if len(goods) == 0 {
return nil
}
log.Printf("inserting %d goods to DB", len(goods))
gormGoods := convertGoodsToGorm(cat, goods)
if err := db.Create(gormGoods).Error; err != nil {
return fmt.Errorf("db Create: %w", err)