Skip to content
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

User provided IDocumentStore is resolved before endpoint startup #444

Open
andreasohlund opened this issue Oct 30, 2019 · 4 comments
Labels
Bug

Comments

@andreasohlund
Copy link
Member

@andreasohlund andreasohlund commented Oct 30, 2019

As reported by a user on the mailing the persister resolves the Func passed to SetDefaultDocumentStore when the features are setup.

This prevents users using IServiceCollection or on immutable containers such as SimpleInjector and Autofac to resolve the document store from their container.

There is no known workaround at this stage.

@andreasohlund andreasohlund added the Bug label Oct 30, 2019
@andreasohlund

This comment has been minimized.

Copy link
Member Author

@andreasohlund andreasohlund commented Oct 30, 2019

As an aside, we also do indexing at this time which arguably also isn't ok since I would expect that to happen during startup?

@mauroservienti

This comment has been minimized.

Copy link
Member

@mauroservienti mauroservienti commented Oct 30, 2019

I think I see what the problem is, I guess we can replace all IDocumentStore dependencies with something like Lazy<IDocumentStore> or pass in the Func<> and let components resolve the document store only when it's needed.

The only issue are indexes, the store is needed to create indexes and those need to be created/updated when the endpoint starts up.

@andreasohlund

This comment has been minimized.

Copy link
Member Author

@andreasohlund andreasohlund commented Oct 31, 2019

I think we can move the indexing to a FeatureStartupTask?

@andreasohlund

This comment has been minimized.

Copy link
Member Author

@andreasohlund andreasohlund commented Oct 31, 2019

I've raised a follow up issue that is an extension of this issue

#445

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.