def send.again
bend-kit-webhooks@0.11.0.1 · webhooks.bend:442
import bend-kit-webhooks@0.11.0.1/webhooks.bend as Webhooks
import Base
import bend-kit-http@0.38.1.1/http.bend as Http
442
443def send.again(r: Result<&1, &1, Http.Err, Http.Res>) ->
444 Result<&1, &1, Http.Err, Http.Res> & Maybe<&2, String>:
445 match r:
446 case Fail{e}:
447 Http.retry.judge(True{}, Fail{e})
448 case Done{res}:
449 Http.Res{+status, +headers, body} = res
450 +again = Bool.or(Http.retry.status(status), U32.is_eq((status / 100 : U32), 5))
451 (Done{Http.Res{status, headers, body}}, Bool.pick(Maybe<&2, String>, again, Some{Http.header(headers, "retry-after")}, None{}))