feat: start media server with no db right after logout (#3505)

This commit is contained in:
yqrashawn 2023-05-18 19:22:20 +08:00 committed by GitHub
parent 6fed50ce53
commit 23138d0dbb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 1 deletions

View File

@ -1 +1 @@
0.151.9
0.151.10

View File

@ -633,6 +633,7 @@ func TestLoginWithKey(t *testing.T) {
require.NoError(t, b.AccountManager().InitKeystore(conf.KeyStoreDir))
b.UpdateRootDataDir(conf.DataDir)
require.NoError(t, b.OpenAccounts())
require.NotNil(t, b.statusNode.HTTPServer())
address := crypto.PubkeyToAddress(walletKey.PublicKey)
require.NoError(t, b.SaveAccountAndStartNodeWithKey(main, "test-pass", testSettings, conf, []*accounts.Account{{Address: address, Wallet: true}}, keyhex))
@ -1063,6 +1064,7 @@ func login(t *testing.T, conf *params.NodeConfig) {
wg.Wait()
require.NoError(t, b.Logout())
require.NotNil(t, b.statusNode.HTTPServer())
require.NoError(t, b.StopNode())
}

View File

@ -1596,6 +1596,12 @@ func (b *GethStatusBackend) Logout() error {
}
// re-initialize the node, at some point we should better manage the lifecycle
b.initialize()
err = b.statusNode.StartMediaServerWithoutDB()
if err != nil {
b.log.Error("failed to start media server without app db", "err", err)
return err
}
return nil
}