threads
This commit is contained in:
@ -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)
|
||||
|
Reference in New Issue
Block a user