Merge branch 'hot-fix/1.0.0' into test

This commit is contained in:
aichy
2022-12-22 11:28:13 +08:00
+3 -1
View File
@@ -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()