all repos — honk @ ee7d7b5b5232c051e3b711a3260ac7892d892c20

my fork of honk

every time I try to get a post from pixelfed, I get a 502 error.
workaround by sleeping and trying again when the PHP cools down.
Ted Unangst tedu@tedunangst.com
Fri, 02 Aug 2019 10:45:42 -0400
commit

ee7d7b5b5232c051e3b711a3260ac7892d892c20

parent

433e1d53bc2d34e78aa9c5917cdf48d1c9998f7f

2 files changed, 12 insertions(+), 0 deletions(-)

jump to
M activity.goactivity.go

@@ -22,6 +22,7 @@ "database/sql"

"fmt" "io" "log" + notrand "math/rand" "net/http" "net/url" "os"

@@ -473,6 +474,15 @@ log.Printf("getting bonk: %s", xid)

obj, err = GetJunk(xid) if err != nil { log.Printf("error regetting: %s", err) + if err.Error() == "http get status: 502" { + time.Sleep(time.Duration(60+notrand.Int63n(60)) * time.Second) + obj, err = GetJunk(xid) + if err != nil { + log.Printf("still couldn't get it") + } else { + log.Printf("retry success!") + } + } } origin = originate(xid) what = "bonk"
M docs/changelog.txtdocs/changelog.txt

@@ -2,6 +2,8 @@ changelog

-- next ++ Add another retry to workaround pixelfed's general unreliability. + + Attached images are not lost when previewing. - Remove sensitivity to spicy peppers.