From 256f5f4af2cf4b3fe7815dd09c8c3d74462fb962 Mon Sep 17 00:00:00 2001 From: Akmal Date: Thu, 25 Jan 2024 17:01:52 +0700 Subject: [PATCH] Retry if embed is empty --- handlers/data/data.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/handlers/data/data.go b/handlers/data/data.go index 7439ce3..649e8b4 100644 --- a/handlers/data/data.go +++ b/handlers/data/data.go @@ -152,7 +152,7 @@ func getData(postID string, p *fastjson.Parser) (*fastjson.Value, error) { var err error for retries := 0; retries < 3; retries++ { err := client.DoTimeout(req, res, timeout) - if err == nil { + if err == nil && len(res.Body()) > 0 { break } }