diff --git a/start.go b/start.go index 5cf3df4..8a5583c 100644 --- a/start.go +++ b/start.go @@ -69,13 +69,14 @@ func NewServer(relay Relay, opts ...Option) (*Server, error) { options: options, } + if err := relay.Storage(context.Background()).Init(); err != nil { + return nil, fmt.Errorf("storage init: %w", err) + } + // init the relay if err := relay.Init(); err != nil { return nil, fmt.Errorf("relay init: %w", err) } - if err := relay.Storage(context.Background()).Init(); err != nil { - return nil, fmt.Errorf("storage init: %w", err) - } // start listening from events from other sources, if any if inj, ok := relay.(Injector); ok {