Skip to content

Commit

Permalink
Undo change to Campaign; no need
Browse files Browse the repository at this point in the history
  • Loading branch information
jcferretti authored Jun 14, 2024
1 parent 7e419db commit 4518b48
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion client/v3/concurrency/election.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ func (e *Election) Campaign(ctx context.Context, val string) error {
k := fmt.Sprintf("%s%x", e.keyPrefix, s.Lease())
txn := client.Txn(ctx).If(v3.Compare(v3.CreateRevision(k), "=", 0))
txn = txn.Then(v3.OpPut(k, val, v3.WithLease(s.Lease())))
txn = txn.Else(v3.OpGet(k, v3.WithFirstCreate()...))
txn = txn.Else(v3.OpGet(k))
resp, err := txn.Commit()
if err != nil {
return err
Expand Down

0 comments on commit 4518b48

Please sign in to comment.