storage: close function
add close function to storage interface add common defer function call which will close db connection remove context as soon as it's not needed anymore updated unit tests
This commit is contained in:
parent
b21a220712
commit
264dfef370
11 changed files with 42 additions and 27 deletions
|
@ -112,7 +112,7 @@ Main:
|
|||
|
||||
// initBlockChain initializes BlockChain with preselected DB.
|
||||
func initBlockChain(context context.Context, cfg config.Config) (*core.Blockchain, error) {
|
||||
store, err := storage.NewStore(context, cfg.ApplicationConfiguration.DBConfiguration)
|
||||
store, err := storage.NewStore(cfg.ApplicationConfiguration.DBConfiguration)
|
||||
if err != nil {
|
||||
return nil, cli.NewExitError(fmt.Errorf("could not initialize storage: %s", err), 1)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue