Merge pull request #3027 from urbit/lf/soto-fix

soto: run +on-load migration once
This commit is contained in:
matildepark 2020-06-18 13:11:19 -04:00 committed by GitHub
commit bef3ea46a0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -6,8 +6,14 @@
/+ *soto, default-agent
|%
+$ card card:agent:gall
+$ state-zero ~
::
+$ versioned-state
$@ state-null
state-zero
::
+$ state-null ~
::
+$ state-zero [%0 ~]
--
=| state-zero
=* state -
@ -18,12 +24,22 @@
sc ~(. soto-core bol)
def ~(. (default-agent this %|) bol)
::
++ on-init [~ this]
++ on-init
:_ this
:_ ~
:* %pass /srv %agent [our.bol %file-server]
%poke %file-server-action
!>([%serve-dir /'~dojo' /app/landscape %.n])
==
++ on-save !>(state)
::
++ on-load
|= old=vase
:_ this(state !<(state-zero old))
|= old-vase=vase
=/ old
!<(versioned-state old-vase)
?^ old
[~ this(state old)]
:_ this(state [%0 ~])
:~ [%pass /bind/soto %arvo %e %disconnect [~ /'~dojo']]
:* %pass /srv %agent [our.bol %file-server]
%poke %file-server-action