| Conditions | 3 |
| Total Lines | 13 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | package memory |
||
| 24 | func (b *BundleWriter) Write(ctx context.Context, bundles []storage.Bundle) (names []string, err error) { |
||
| 25 | txn := b.database.DB.Txn(true) |
||
| 26 | defer txn.Abort() |
||
| 27 | |||
| 28 | for _, bundle := range bundles { |
||
| 29 | if err = txn.Insert(constants.BundlesTable, bundle); err != nil { |
||
| 30 | return []string{}, errors.New(base.ErrorCode_ERROR_CODE_EXECUTION.String()) |
||
| 31 | } |
||
| 32 | names = append(names, bundle.Name) |
||
| 33 | } |
||
| 34 | txn.Commit() |
||
| 35 | |||
| 36 | return names, nil |
||
| 37 | } |
||
| 54 |