MichaelErmer / eveonlinejs

Node.js/io.js EVE API Client
MIT License
27 stars 4 forks source link

Add rate-limiter #5

Closed nornagon closed 8 years ago

nornagon commented 8 years ago

Just to be safe :) The cache handler should take care of rate limiting most of the time, but this guarantees that the overall query rate stays below the 30/sec limit.

MichaelErmer commented 8 years ago

Can you add the rateLimit to the options with a default to 30? if set to 0 it should disable the rateLimiter entirely.

Reason: There are some people, including myself, that use an API proxy that handles rate limits and uses multiple IP addresses to query the CCP end, so they don't need a rateLimit.

nornagon commented 8 years ago

Done. (Is the EVE ratelimit per-key as well as per-IP? Using multiple IPs seems kind of shady...)

MichaelErmer commented 8 years ago

Thanks & merged As for various IP's I don't know if its shady if you still mind the cacheTimers, its easier to use 10 ips than get CCP to increase your query rate limit individually.