mirror of
https://github.com/urbit/shrub.git
synced 2024-12-11 11:02:25 +03:00
improves :dns self-check-http (slightly)
This commit is contained in:
parent
e3986b4065
commit
3a3d7872d7
19
app/dns.hoon
19
app/dns.hoon
@ -48,13 +48,16 @@
|
||||
::
|
||||
++ request
|
||||
|= =hiss:eyre
|
||||
=/ m (async:stdio httr:eyre)
|
||||
=/ m (async:stdio (unit httr:eyre))
|
||||
^- form:m
|
||||
;< ~ bind:m (send-hiss:stdio hiss)
|
||||
take-sigh:stdio
|
||||
take-maybe-sigh:stdio
|
||||
::
|
||||
:: +self-check-http: confirm our availability at .host on port 80
|
||||
::
|
||||
:: XX needs better success/failure predicates
|
||||
:: XX bind route to self and handle request inside tx?
|
||||
::
|
||||
++ self-check-http
|
||||
|= [=host:eyre max=@ud]
|
||||
=/ m (async:stdio ?)
|
||||
@ -71,11 +74,15 @@
|
||||
?: =(try max)
|
||||
(pure:m |)
|
||||
;< ~ bind:m (backoff try ~h1)
|
||||
;< =httr:eyre bind:m (request hiss)
|
||||
:: XX needs a better predicate. LTE will make this easier
|
||||
::
|
||||
?: =(200 p.httr)
|
||||
;< rep=(unit httr:eyre) bind:m (request hiss)
|
||||
?: ?& ?=(^ rep)
|
||||
|(=(200 p.u.rep) =(307 p.u.rep))
|
||||
==
|
||||
(pure:m &)
|
||||
?. ?| ?=(~ rep)
|
||||
=(504 p.u.rep)
|
||||
==
|
||||
(pure:m |)
|
||||
loop(try +(try))
|
||||
::
|
||||
++ hall-app-message
|
||||
|
Loading…
Reference in New Issue
Block a user