Skip to content

Commit

Permalink
addressing comments
Browse files Browse the repository at this point in the history
  • Loading branch information
sandeepvinayak committed Jan 22, 2025
1 parent c95f790 commit d87f80e
Show file tree
Hide file tree
Showing 30 changed files with 8,210 additions and 3,244 deletions.
5 changes: 4 additions & 1 deletion docstore/awsdynamodb/dynamo.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ func (c *collection) RunActions(ctx context.Context, actions []*driver.Action, o
go func() { defer close(ch2); c.transactWrite(ctx, writesTx, errs, opts) }()
c.runGets(ctx, gets, errs, opts)
<-ch
<-ch2
c.runGets(ctx, afterGets, errs, opts)
return driver.NewActionListError(errs)
}
Expand Down Expand Up @@ -615,6 +616,7 @@ func revisionPrecondition(doc driver.Document, revField string) (*expression.Con
return &cb, nil
}

// transactWrite execute the write actions in an atomic manner, either they all succeed or they all fail together.
func (c *collection) transactWrite(ctx context.Context, actions []*driver.Action, errs []error, opts *driver.RunActionsOptions) {
if len(actions) == 0 {
return
Expand All @@ -630,7 +632,8 @@ func (c *collection) transactWrite(ctx context.Context, actions []*driver.Action
for _, w := range actions {
op, err := c.newWriteOp(w, opts)
if err != nil {
errs[w.Index] = err
setErr(err)
return
} else {
ops = append(ops, op)
tws = append(tws, op.writeItem)
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit d87f80e

Please sign in to comment.