Merge branch 'zedeus:master' into master

This commit is contained in:
Jonas Chopin-Revel 2023-01-08 19:53:13 +01:00 committed by GitHub
commit c9c82d2782
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 5 deletions

View file

@ -20,7 +20,7 @@ requires "packedjson#9e6fbb6"
requires "supersnappy#6c94198"
requires "redpool#8b7c1db"
requires "https://github.com/zedeus/redis#d0a0e6f"
requires "zippy#61922b9"
requires "zippy#88a5a5a"
requires "flatty#9f885d7"
requires "jsony#d0e69bd"

View file

@ -23,7 +23,7 @@ proc genParams*(pars: openArray[(string, string)] = @[]; cursor="";
result &= ("count", count)
if cursor.len > 0:
# The raw cursor often has plus signs, which sometimes get turned into spaces,
# so we need to them back into a plus
# so we need to turn them back into a plus
if " " in cursor:
result &= ("cursor", cursor.replace(" ", "+"))
else:
@ -69,9 +69,7 @@ template fetchImpl(result, fetchBody) {.dirty.} =
# Twitter randomly returns 401 errors with an empty body quite often.
# Retrying the request usually works.
var attempt = 0
while resp.status == "401 Unauthorized" and result.len == 0 and attempt < 3:
inc attempt
if resp.status == "401 Unauthorized" and result.len == 0:
getContent()
if resp.status == $Http503: