(ctx context.Context, startTs uint64, hash string)
| 558 | } |
| 559 | |
| 560 | func handleAbort(ctx context.Context, startTs uint64, hash string) (map[string]interface{}, error) { |
| 561 | tc := &api.TxnContext{ |
| 562 | StartTs: startTs, |
| 563 | Aborted: true, |
| 564 | Hash: hash, |
| 565 | } |
| 566 | |
| 567 | tctx, err := (&edgraph.Server{}).CommitOrAbort(ctx, tc) |
| 568 | switch { |
| 569 | case tctx.Aborted: |
| 570 | return map[string]interface{}{ |
| 571 | "code": x.Success, |
| 572 | "message": "Done", |
| 573 | }, nil |
| 574 | case err == nil: |
| 575 | return nil, errors.Errorf("transaction could not be aborted") |
| 576 | default: |
| 577 | return nil, err |
| 578 | } |
| 579 | } |
| 580 | |
| 581 | func handleCommit(ctx context.Context, |
| 582 | startTs uint64, hash string, reqText []byte) (map[string]interface{}, error) { |
no test coverage detected