mirror of
https://github.com/tloncorp/landscape.git
synced 2024-12-29 11:42:41 +03:00
patch many minor issues with 'vitals/connection-check.hoon' thread
* skip sponsor checks for galaxies (avoids a crash in /app/vitals/hoon) * mark peers unknown to %ames as %dead (avoids a crash in /ax/peers/...) * change thread input from @p to (unit @p) (allow calling from dojo)
This commit is contained in:
parent
1088a242e1
commit
e1088e1e55
@ -138,7 +138,7 @@
|
||||
%landscape
|
||||
%vitals-connection-check
|
||||
%noun
|
||||
!>(ship)
|
||||
!>((some ship))
|
||||
==
|
||||
?: ?=(%pending -.status.u.stat)
|
||||
cor
|
||||
@ -153,7 +153,7 @@
|
||||
%landscape
|
||||
%vitals-connection-check
|
||||
%noun
|
||||
!>(ship)
|
||||
!>((some ship))
|
||||
==
|
||||
::
|
||||
:: public pokes
|
||||
|
@ -10,7 +10,7 @@
|
||||
|= arg=vase
|
||||
=/ m (strand ,vase)
|
||||
^- form:m
|
||||
=+ !<(target=ship arg)
|
||||
=+ !<([~ target=ship] arg)
|
||||
;< our=@p bind:m get-our:io
|
||||
|^
|
||||
:: early exit; check if we have live path to target
|
||||
@ -33,7 +33,13 @@
|
||||
:: set pending to %trying-local
|
||||
;< ~ bind:m (update-status [%trying-local ~])
|
||||
:: check if we can contact our own galaxy
|
||||
;< gqos=qos:ames bind:m (scry:io qos:ames ~[%gx %vitals %galaxy %vitals-qos])
|
||||
;< gqos=qos:ames
|
||||
bind:m
|
||||
=/ mm (strand ,qos:ames)
|
||||
^- form:mm
|
||||
?: ?=(%czar (clan:title our))
|
||||
(pure:mm [%live *@da])
|
||||
(scry:io qos:ames ~[%gx %vitals %galaxy %vitals-qos])
|
||||
?. ?=(%live -.gqos)
|
||||
(post-result [%no-our-galaxy last-contact.gqos])
|
||||
:: set pending to %trying-target
|
||||
@ -104,12 +110,15 @@
|
||||
^- update:vitals
|
||||
[target now %pending pending]
|
||||
++ get-qos
|
||||
|= =ship
|
||||
|= peer=ship
|
||||
=/ m (strand ,qos:ames)
|
||||
^- form:m
|
||||
;< state=ship-state:ames
|
||||
bind:m
|
||||
(scry:io ship-state:ames ~[%ax %$ %peers (scot %p ship)])
|
||||
;< peers=(map ship ?(%alien %known)) bind:m
|
||||
(scry:io (map ship ?(%alien %known)) ~[%ax %$ %peers])
|
||||
?. (~(has by peers) peer)
|
||||
(pure:m [%dead *@da])
|
||||
;< state=ship-state:ames bind:m
|
||||
(scry:io ship-state:ames ~[%ax %$ %peers (scot %p peer)])
|
||||
(pure:m (simplify-qos:lib-vitals state))
|
||||
++ galaxy-down
|
||||
|= galaxy=ship
|
||||
|
Loading…
Reference in New Issue
Block a user