79602777

Date: 2025-05-02 03:42:23
Score: 1
Natty:
Report link

This can be solved using throttled-py.

from datetime import timedelta
from throttled import Throttled, rate_limiter, RateLimiterType

quota = rate_limiter.per_duration(timedelta(minutes=5), limit=5)

# Supports multiple algorithms, use Token Bucket by default.
@Throttled(key="StashNotes", quota=quota)
def StashNotes():
    return "StashNotes"

If the limit is exceeded, a LimitedError is thrown: throttled.exceptions.LimitedError: Rate limit exceeded: remaining=0, reset_after=300, retry_after=60..

Reasons:
  • Contains signature (1):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: crayon