添加安全锁
This commit is contained in:
parent
a80ac1cc10
commit
da9192d356
@ -197,8 +197,17 @@ func (this *Buried) FinishConditionAndCheck(uid string, finishcondiIds []int32,
|
|||||||
if bdatas, err = this.modelBuried.getUserBurieds(uid); err != nil {
|
if bdatas, err = this.modelBuried.getUserBurieds(uid); err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
condis = make([]*pb.ConIProgress, 0)
|
|
||||||
|
|
||||||
|
this.Debug("完成埋点!", log.Field{Key: "finishcondiIds", Value: finishcondiIds})
|
||||||
|
lock, _ := this.modelBuried.userlock(uid)
|
||||||
|
err = lock.Lock()
|
||||||
|
if err != nil {
|
||||||
|
this.Error("埋点分布式锁失效 err!", log.Field{Key: "uid", Value: uid}, log.Field{Key: "err", Value: err.Error()})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
defer lock.Unlock()
|
||||||
|
|
||||||
|
condis = make([]*pb.ConIProgress, 0)
|
||||||
for _, v := range finishcondiIds {
|
for _, v := range finishcondiIds {
|
||||||
if conf, err = this.configure.getburiedcondidata(v); err != nil {
|
if conf, err = this.configure.getburiedcondidata(v); err != nil {
|
||||||
return
|
return
|
||||||
|
Loading…
Reference in New Issue
Block a user