|
@@ -131,10 +131,11 @@ func adsHandler(c *gin.Context) {
|
131
|
131
|
// 频率控制
|
132
|
132
|
freqControlConf, err := redis_data.GetFreqCrontolConf(request.ReqSource)
|
133
|
133
|
if err != nil {
|
134
|
|
- c.String(404, "get freq control conf failed")
|
|
134
|
+ c.String(404, "get freq control conf failed: %s", err)
|
135
|
135
|
return
|
136
|
136
|
}
|
137
|
137
|
|
|
138
|
+ fmt.Printf("freq control conf: %+v\n", freqControlConf)
|
138
|
139
|
hour, _ := strconv.Atoi(time.Now().Format("01"))
|
139
|
140
|
tmpControlInterval, ok := freqControlConf.GetControlTime(hour)
|
140
|
141
|
if ok {
|
|
@@ -144,7 +145,8 @@ func adsHandler(c *gin.Context) {
|
144
|
145
|
|
145
|
146
|
lastReqTime, err := device.GetIpReqTime(ip)
|
146
|
147
|
if err != nil {
|
147
|
|
- c.String(404, "get last req time failed")
|
|
148
|
+ fmt.Println(err)
|
|
149
|
+ c.String(404, "get last req time failed: %s", err)
|
148
|
150
|
return
|
149
|
151
|
}
|
150
|
152
|
|
|
@@ -161,7 +163,7 @@ func adsHandler(c *gin.Context) {
|
161
|
163
|
//### 检查是否是ip黑名单
|
162
|
164
|
isIpBlack, err := ads_checker.CheckBlackIp(ip)
|
163
|
165
|
if err != nil {
|
164
|
|
- c.String(404, "get city code failed")
|
|
166
|
+ c.String(404, "check black ip failed: %s", err)
|
165
|
167
|
return
|
166
|
168
|
}
|
167
|
169
|
if isIpBlack {
|
|
@@ -172,7 +174,7 @@ func adsHandler(c *gin.Context) {
|
172
|
174
|
// 获取渠道的黑白性
|
173
|
175
|
reqChannelFlag, err := redis_data.GetChannelFlag(request.ReqSource, "ads_req")
|
174
|
176
|
if err != nil {
|
175
|
|
- c.String(404, "get req channel flag failed")
|
|
177
|
+ c.String(404, "get req channel flag failed: %s", err)
|
176
|
178
|
return
|
177
|
179
|
}
|
178
|
180
|
flowWeight := reqChannelFlag.Weigth
|