1
0
mirror of https://github.com/pocketbase/pocketbase.git synced 2025-11-25 15:42:01 +02:00

added the triggered rate limit rule in the error log details

This commit is contained in:
Gani Georgiev
2025-06-25 20:32:51 +03:00
parent 3f3b77dcd4
commit 2c6f99418f
4 changed files with 56 additions and 6 deletions

View File

@@ -704,3 +704,13 @@ func (c RateLimitRule) Validate() error {
func (c RateLimitRule) DurationTime() time.Duration {
return time.Duration(c.Duration) * time.Second
}
// String returns a string representation of the rule.
func (c RateLimitRule) String() string {
raw, err := json.Marshal(c)
if err != nil {
return c.Label // extremely rare case
}
return string(raw)
}