-
Notifications
You must be signed in to change notification settings - Fork 113
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Database loading statuses #5405
base: master
Are you sure you want to change the base?
Conversation
localStorage, err := NewLocalBackend(commonNode.Runtime.DataDir(), id) | ||
if err != nil { | ||
return fmt.Errorf("can't create local storage backend: %w", err) | ||
storageCtor := func(ctx context.Context) (storageApi.LocalBackend, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason why we don't create the local storage backend in committee/node
? This would avoid passing in this factory function.
@@ -200,6 +202,31 @@ func NewNode( | |||
|
|||
n.ctx, n.ctxCancel = context.WithCancel(context.Background()) | |||
|
|||
go func() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't doing this async dangerous? Where do we ensure that start is not called before this completes? Related goroutines should probably block on a channel that gets closed once this deferred init completes?
go/worker/storage/worker.go
Outdated
if err != nil { | ||
return nil, fmt.Errorf("can't create local storage backend: %w", err) | ||
} | ||
commonNode.Runtime.RegisterStorage(localStorage) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are there any issues if this happens async?
2fa23d8
to
1e986d6
Compare
No description provided.