feat: 管理端网站监控,浏览量写入独立 monitor.db
请求日志按日 JSONL;page_views 不进主库,避免统计数据撑大 jiang13.db。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -57,6 +57,9 @@ func (r *RateLimiter) limitFor(action string) int {
|
||||
if action == "community_heartbeat" {
|
||||
return 30
|
||||
}
|
||||
if action == "monitor_pageview" {
|
||||
return 120 // SPA 路由切换较频繁
|
||||
}
|
||||
return r.settings.RateLimitFor(action)
|
||||
}
|
||||
|
||||
@@ -67,6 +70,9 @@ func (r *RateLimiter) windowFor(action string) time.Duration {
|
||||
if action == "community_heartbeat" {
|
||||
return time.Hour
|
||||
}
|
||||
if action == "monitor_pageview" {
|
||||
return time.Minute
|
||||
}
|
||||
return time.Duration(r.settings.RateLimitWindowSec()) * time.Second
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user