engine: Rename world API and add a context

We want to be able to pass ctx through for various reasons.
This commit is contained in:
James Shubin
2025-06-02 14:59:41 -04:00
parent 99d8846934
commit 16ade43caf
6 changed files with 26 additions and 26 deletions

View File

@@ -640,11 +640,11 @@ func (obj *Main) Run() error {
obj.Logf("world: etcd: "+format, v...)
},
}
if err := world.Init(worldInit); err != nil {
return errwrap.Wrapf(err, "world Init failed")
if err := world.Connect(exitCtx, worldInit); err != nil {
return errwrap.Wrapf(err, "world Connect failed")
}
defer func() {
err := errwrap.Wrapf(world.Close(), "world Close failed")
err := errwrap.Wrapf(world.Cleanup(), "world Cleanup failed")
if err != nil {
// TODO: cause the final exit code to be non-zero?
Logf("close error: %+v", err)