Skip to content

Stacked limits #69

Description

@rm-hull

Is it possible to run "stacked" rate limits, eg.

@sleep_and_retry
@limits(calls=15, period=ONE_MINUTE)
@limits(calls=500, period=TWENTYFOUR_HOURS)
def call_api(url):
    ...

ie.no more than 15 per minute and no more than 500 in a 24-hr period.

I suppose you could achieve the same with something like:

@sleep_and_retry
@limits(calls=500, period=TWENTYFOUR_HOURS)
def call_api(url):
    return inner_api(url)

@sleep_and_retry
@limits(calls=15, period=ONE_MINUTE)
def inner_api(url):
    ...

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions