ted/glob: add exponential retry

Fixes urbit/urbit#4958
This commit is contained in:
Liam Fitzgerald 2021-06-15 07:57:02 +10:00
parent 179046c92e
commit 9cbc218731
No known key found for this signature in database
GPG Key ID: D390E12C61D1CFFB

View File

@ -7,7 +7,12 @@
^- form:m
=+ !<([~ hash=@uv] arg)
=/ url "https://bootstrap.urbit.org/glob-{(scow %uv hash)}.glob"
;< =cord bind:m (fetch-cord:strandio url)
~| failed-glob+hash
=+ ;;(=glob:glob (cue cord))
;< =glob:glob bind:m
%+ (retry:strandio ,glob:glob) `5
=/ n (strand ,(unit glob:glob))
;< =cord bind:n (fetch-cord:strandio url)
%- pure:n
%- mole
|.
;;(=glob:glob (cue cord))
(pure:m !>(glob))