def retry.tok
cswap-bend-cli@0.1.0.0 · usage.bend:73
import cswap-bend-cli@0.1.0.0/usage.bend as Usage
import Base
import cswap-bend-cli@0.1.0.0/json.bend as Json
import cswap-bend-cli@0.1.0.0/usage/req.bend as UReq
73def retry.tok(m: Maybe<&2, String>, new: String, +now: U32, +off: U32) -> IO(Fetched):
74 match m:
75 case None{}:
76 done(out.kind("refresh-failed", None{}), Some{new})
77 case Some{t}:
78 IO.bind(Result<&2, &2, UReq.Err, Json.Json>, Fetched, UReq.request_usage_data(t, False{}),
79 r => final.pick(r, now, off, Some{new}))