实现叫号播报并调整现场业务规则
需求描述:发布屏在员工叫号后播放语音;同场次手机号被叫号后可重新取号;登录连续失败限制调整为10次。 实现思路:发布屏按新批次去重触发中文语音;重复手机号仅拦截WAITING号码;登录限流使用10次阈值,并补充前后端回归测试与接口说明。
This commit is contained in:
@@ -5,6 +5,8 @@ import (
|
||||
"time"
|
||||
)
|
||||
|
||||
const loginFailureLimit = 10
|
||||
|
||||
type loginAttempt struct {
|
||||
failures int
|
||||
windowStart time.Time
|
||||
@@ -93,7 +95,7 @@ func (l *loginLimiter) failure(key string) {
|
||||
attempt = loginAttempt{windowStart: now}
|
||||
}
|
||||
attempt.failures++
|
||||
if attempt.failures >= 5 {
|
||||
if attempt.failures >= loginFailureLimit {
|
||||
attempt.blockedTill = now.Add(10 * time.Minute)
|
||||
}
|
||||
l.attempts[key] = attempt
|
||||
|
||||
Reference in New Issue
Block a user