fix(xp): already removed never reset

This commit is contained in:
Anhgelus Morhtuuzh 2024-04-15 19:42:32 +02:00
parent 76745af0e8
commit 5655170779
No known key found for this signature in database
GPG key ID: CF4550297832A29F

View file

@ -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,