forked from rojo-rbx/rojo
Fix timeout issue for real this time
This commit is contained in:
@@ -140,14 +140,18 @@ end
|
|||||||
function ApiContext:retrieveMessages()
|
function ApiContext:retrieveMessages()
|
||||||
local url = ("%s/api/subscribe/%s"):format(self.baseUrl, self.messageCursor)
|
local url = ("%s/api/subscribe/%s"):format(self.baseUrl, self.messageCursor)
|
||||||
|
|
||||||
return Http.get(url)
|
local function sendRequest()
|
||||||
:catch(function(err)
|
return Http.get(url)
|
||||||
if err.type == HttpError.Error.Timeout then
|
:catch(function(err)
|
||||||
return Http.get(url)
|
if err.type == HttpError.Error.Timeout then
|
||||||
end
|
return sendRequest()
|
||||||
|
end
|
||||||
|
|
||||||
return Promise.reject(err)
|
return Promise.reject(err)
|
||||||
end)
|
end)
|
||||||
|
end
|
||||||
|
|
||||||
|
return sendRequest()
|
||||||
:andThen(rejectFailedRequests)
|
:andThen(rejectFailedRequests)
|
||||||
:andThen(function(response)
|
:andThen(function(response)
|
||||||
local body = response:json()
|
local body = response:json()
|
||||||
|
|||||||
Reference in New Issue
Block a user