π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
[server] Reduce discord message frequency
Neeraj Gupta7de60f1ceda8
diff --git a/server/pkg/middleware/rate_limit.go b/server/pkg/middleware/rate_limit.goindex fede9ec877..08e0f00b66 100644--- a/server/pkg/middleware/rate_limit.go+++ b/server/pkg/middleware/rate_limit.go@@ -76,7 +76,9 @@ func rateLimiter(interval string) *limiter.Limiter {func (r *RateLimitMiddleware) GlobalRateLimiter() gin.HandlerFunc {return func(c *gin.Context) {if !r.Increment() {- go r.discordCtrl.NotifyPotentialAbuse("Global rate limit breached")+ if r.count%100 == 0 {+ go r.discordCtrl.NotifyPotentialAbuse(fmt.Sprintf("Global ratelimit (%d) breached %d", r.limit, r.count))+ }c.AbortWithStatusJSON(http.StatusTooManyRequests, gin.H{"error": "Rate limit breached, try later"})return}