dazinator / Dotnettency

Mutlitenancy for dotnet applications
MIT License
111 stars 23 forks source link

IHostApplicationLifetime needs to be singleton not singleton per tenant. #74

Open dazinator opened 4 years ago

dazinator commented 4 years ago

Seen an issue with tryign to register signal-r per tenant, in that it relies on IHostApplicationLifetime (provided by the host) to be signalled, in order to start it's background connection managment loop which does things like issue "Keep-alive" pings for connected clients.

The issue is that each tenant is currently getting their own instance of IHostApplicationLifetime because its registered by type, not by by isntance, so the child container creates its own instance per tenant.

Should perhaps add logic to register the application (existing) instance into each child container rather than add a type registration per tenant.

https://github.com/dotnet/aspnetcore/discussions/26056