finish handleDelayedTask

Browse Source
main
git 2024-06-08 09:51:10 +08:00
parent 3b550dd8e5
commit 73ffb245d5
Signed by: git
GPG Key ID: 3F65EFFA44207ADD
1 changed files with 2 additions and 2 deletions

View File

@ -53,8 +53,8 @@ func (d *deliver) assign(key string) error {
return err return err
} }
cmp := clientv3.Compare(clientv3.ModRevision(assignKey), "=", "0") cmp := clientv3.Compare(clientv3.CreateRevision(assignKey), "=", 0)
putReq := clientv3.OpPut(assignKey, "node", clientv3.WithLease(grantResp.ID), clientv3.WithCreatedNotify()) putReq := clientv3.OpPut(assignKey, "node", clientv3.WithLease(grantResp.ID))
getReq := clientv3.OpGet(key) getReq := clientv3.OpGet(key)
resp, err := d.client.Txn(ctx).If(cmp).Then(putReq, getReq).Commit() resp, err := d.client.Txn(ctx).If(cmp).Then(putReq, getReq).Commit()
if err != nil { if err != nil {