kiln: always check local desk when adjusting dudes

We do not care about what's on foreign, the local desk is the thing
we're taking action on. This is more robust in the face of absent
information about foreign desks etc.

Also stops pretending to take-commet during take-merge-main. We'll get a
separate commit event.
This commit is contained in:
Fang 2021-09-28 00:57:38 +04:00
parent 18bad9c423
commit 18701b2ad2
No known key found for this signature in database
GPG Key ID: EB035760C1BBA972
2 changed files with 8 additions and 12 deletions

View File

@ -747,7 +747,7 @@
=? vats liv.rein.rak
%- stop-dudes
=< idle
(adjust-dudes [our loc now] `[ship desk aeon]:ral rein.rak)
(adjust-dudes [our loc now] rein.rak)
=. rail.rak `%*(. ral aeon +(aeon:ral))
|^ ^+ vats
?: =(%base loc)
@ -851,7 +851,7 @@
%- (slog leaf/- p.p.syn)
=. vats (emit (diff:give %merge-fail loc rak p.p.syn))
vats
=. vats take-commit
~> %slog.(fmt "merge into {<loc>} succeeded")
?. =(%base loc)
vats
~> %slog.(fmt "merging %base into %kids at {<kel>}")
@ -895,8 +895,7 @@
++ update-running-dudes
^+ vats
=/ local [our loc now]
=/ upstream ?~(rail.rak ~ `[ship desk aeon]:u.rail.rak)
=/ dif (adjust-dudes local upstream rein.rak)
=/ dif (adjust-dudes local rein.rak)
=. vats (start-dudes jolt.dif)
=. vats (stop-dudes idle.dif)
vats

View File

@ -130,12 +130,14 @@
++ read-bill-foreign
|= [=ship =desk =aeon]
^- (list dude)
~| +<
=/ her (scot %p ship)
=/ syd (scot %tas desk)
=/ yon (scot %ud aeon)
::
=/ dom .^(dome cv/~[her syd yon])
=/ tak (scot %uv (~(got by hit.dom) aeon))
=/ tak ~| aeons=~(key by hit.dom)
(scot %uv (~(got by hit.dom) aeon))
=/ yak .^(yaki cs/~[her syd yon %yaki tak])
=/ fil (~(get by q.yak) /desk/bill)
?~ fil ~
@ -165,16 +167,11 @@
::
++ adjust-dudes
|= $: local=[our=ship =desk now=@da]
upstream=(unit [=ship =desk =aeon])
=rein
==
^- [jolt=(list dude) idle=(list dude)]
=/ all=(list dude)
?~ upstream
(read-bill local)
?: =(ship.u.upstream our.local)
(read-bill local(desk desk.u.upstream))
(read-bill-foreign u.upstream)
=/ want (get-apps-want all rein)
=/ have (get-apps-live local)
[want (skip have ~(has in (sy want)))]