request_limit: Check Request Limit

Description Usage Arguments Details Value

View source: R/utils.R

Description

A function that stores the number of requests made to the API within a given time period. If the limit is reached then the code will stall until requests are free to query the API again successfully. The API is constrained to 1000 request per hour (default), or x calls per t time. So this function is checked each time before an endpoint is hit and waits a given time if no requests are remaining.

Usage

1
request_limit(KEYS, requestsAllowed = 1000, timePeriod = 60 * 60)

Arguments

requestsAllowed

An integer value that defines the number of requests that can be made in a given time period (Default = 1000).

timePeriod

An integer value in seconds that defines the time period where 'requestsAllowed' API calls are allowed (Default = 60 * 60).

Details

Redis Keys used;

Value

Nothing. Redis is updated with the correct requestLimit values.


ntyndall/footballstats documentation built on Aug. 13, 2019, 1:36 p.m.