Skip to content

Commit

Permalink
Merge pull request opsdroid#25 from Cadair/master
Browse files Browse the repository at this point in the history
Fix 429 again
  • Loading branch information
SolarDrew committed Apr 13, 2018
2 parents 41c655e + 226a7e0 commit e989b84
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion matrix_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ async def _send(self,
headers=headers)
async with request as response:
if response.status == 429:
await sleep(response.json()['retry_after_ms'] / 1000)
respjson = await response.json()
await sleep(respjson['retry_after_ms'] / 1000)
elif response.status < 200 or response.status >= 300:
raise MatrixRequestError(
code=response.status, content=await response.text())
Expand Down

0 comments on commit e989b84

Please sign in to comment.