From ffc13e645c7a20cb3f6fb8c45b04fb82d8170904 Mon Sep 17 00:00:00 2001 From: Candid Dauth Date: Wed, 24 May 2017 00:29:25 +0200 Subject: [PATCH] Hopefully fix rate limit errors for elevation service --- server/elevation.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/elevation.js b/server/elevation.js index 04ad49cb..be9cf4cd 100644 --- a/server/elevation.js +++ b/server/elevation.js @@ -11,10 +11,10 @@ const request = require("request-promise").defaults({ const API_URL = "https://elevation.mapzen.com/height"; const API_KEY = "mapzen-LWPWRB1"; const LIMIT = 500; -const PER_SECOND_LIMIT = 2; +const MIN_TIME_BETWEEN_REQUESTS = 600; const throttle = highland(); -throttle.ratelimit(PER_SECOND_LIMIT, 1000).each((func) => { +throttle.ratelimit(1, MIN_TIME_BETWEEN_REQUESTS).each((func) => { func(); });