mirror of
https://github.com/TeamPiped/RYD-Proxy.git
synced 2024-08-14 23:55:54 +00:00
Close body on 429 & fix docker file with use of fiber prefork
This commit is contained in:
parent
fb2956e24b
commit
1a35e6dce4
2 changed files with 9 additions and 2 deletions
|
@ -15,5 +15,8 @@ RUN apk --no-cache add --no-check-certificate ca-certificates \
|
||||||
|
|
||||||
COPY --from=build /app/main /ryd-proxy
|
COPY --from=build /app/main /ryd-proxy
|
||||||
|
|
||||||
|
RUN apk add dumb-init
|
||||||
|
ENTRYPOINT ["/usr/bin/dumb-init", "--"]
|
||||||
|
|
||||||
EXPOSE 3000
|
EXPOSE 3000
|
||||||
CMD [ "/ryd-proxy" ]
|
CMD "/ryd-proxy"
|
||||||
|
|
6
main.go
6
main.go
|
@ -91,12 +91,16 @@ func getVotes(c *fiber.Ctx, videoId string) error {
|
||||||
|
|
||||||
resp, err := client.Do(req)
|
resp, err := client.Do(req)
|
||||||
|
|
||||||
if err != nil || resp.StatusCode == 429 {
|
if err != nil {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
defer resp.Body.Close()
|
defer resp.Body.Close()
|
||||||
|
|
||||||
|
if resp.StatusCode == 429 {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
ce := resp.Header.Get("Content-Encoding")
|
ce := resp.Header.Get("Content-Encoding")
|
||||||
|
|
||||||
var stream io.Reader
|
var stream io.Reader
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue