allow to skip item by created
This commit is contained in:
@ -248,18 +248,20 @@ func (c *goodsItemClient) upsertByBatch(ctx context.Context, items []entity.Good
|
||||
batch := c.db.NewWriteBatch()
|
||||
defer batch.Cancel()
|
||||
|
||||
createdAt := time.Now()
|
||||
err := func() error {
|
||||
for _, item := range items {
|
||||
if ctx.Err() != nil {
|
||||
return ctx.Err()
|
||||
}
|
||||
|
||||
key := c.prefixedStr(item.Articul)
|
||||
item.CreatedAt = createdAt
|
||||
value, err := c.s.Serialize(item)
|
||||
if err != nil {
|
||||
return fmt.Errorf("serializing item: %w", err)
|
||||
}
|
||||
|
||||
key := c.prefixedStr(item.Articul)
|
||||
idxValue := make([]byte, len(key))
|
||||
copy(idxValue, key)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user