fix(xp): already removed never reset
This commit is contained in:
parent
76745af0e8
commit
5655170779
1 changed files with 10 additions and 1 deletions
11
xp/member.go
11
xp/member.go
|
@ -70,6 +70,15 @@ func (c *Copaing) SetLastEvent() {
|
||||||
utils.SendAlert("xp/member.go - Setting last event", err.Error(), "time", t, "base_key", u.GenKey())
|
utils.SendAlert("xp/member.go - Setting last event", err.Error(), "time", t, "base_key", u.GenKey())
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
err = client.Set(context.Background(), fmt.Sprintf(
|
||||||
|
"%s:%s",
|
||||||
|
u.GenKey(),
|
||||||
|
AlreadyRemoved,
|
||||||
|
), "0", 0).Err()
|
||||||
|
if err != nil {
|
||||||
|
utils.SendAlert("xp/member.go - Setting already removed to 0", err.Error(), "time", t, "base_key", u.GenKey())
|
||||||
|
return
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Copaing) HourSinceLastEvent() uint {
|
func (c *Copaing) HourSinceLastEvent() uint {
|
||||||
|
@ -120,7 +129,7 @@ func (c *Copaing) AddXPAlreadyRemoved(xp uint) uint {
|
||||||
), exp, 0).Err()
|
), exp, 0).Err()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
utils.SendAlert(
|
utils.SendAlert(
|
||||||
"xp/member.go - Setting last event",
|
"xp/member.go - Setting already removed",
|
||||||
err.Error(),
|
err.Error(),
|
||||||
"xp already removed",
|
"xp already removed",
|
||||||
exp,
|
exp,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue