A Q&A platform software for teams at any scales. Whether it's a community forum, help center, or knowledge management platform, you can always count on Apache Answer.
update GetActionType
aichyc5f20d4e4f7a
diff --git a/internal/repo/captcha/captcha.go b/internal/repo/captcha/captcha.goindex 13f6d476..02e8ab8a 100644--- a/internal/repo/captcha/captcha.go+++ b/internal/repo/captcha/captcha.go@@ -34,7 +34,9 @@ func (cr *captchaRepo) SetActionType(ctx context.Context, ip, actionType string,}func (cr *captchaRepo) GetActionType(ctx context.Context, ip, actionType string) (amount int, err error) {- cacheKey := fmt.Sprintf("ActionRecord:%s@%s", ip, actionType)+ //cacheKey := fmt.Sprintf("ActionRecord:%s@%s", ip, actionType)+ //Detects behavior based on ip only+ cacheKey := fmt.Sprintf("ActionRecord:%s@", ip)res, err := cr.data.Cache.GetInt64(ctx, cacheKey)if err != nil {err = errors.InternalServer(reason.DatabaseError).WithError(err).WithStack()