You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have been using UseBranchWithServices for quite sometime now and it is great.
I'm using it for multitenancy with IdentityServer4. One branch per tenant.
The problem I have is that I want to create new tenants dynamically without restarting the app.
For example, if I want to add new branches with newly created tenants every 15s, I could do something like this:
Task.Run(async () =>
{
while (true)
{
List<string> oldTenantIds = TenantIds ?? new List<string>();
TenantIds = GetTenants(db);
var tenantIdsToSubscribe = TenantIds.Except(oldTenantIds).ToList();
if (tenantIdsToSubscribe.Count != 0)
foreach (string tenantId in tenantIdsToSubscribe)
app.UseBranchWithServices($"/{tenantId}",
services => GenericServicesConfig(services, db, tenantId),
appBuilder => GenericAppBuilderConfig(appBuilder));
await Task.Delay(15000);
}
});
But this doesn't seem to work.
If I do this on startup without the Task.Run/while(true)/Task.Delay, it works.
Any idea?
Thanks!
The text was updated successfully, but these errors were encountered:
Hi!
I have been using
UseBranchWithServices
for quite sometime now and it is great.I'm using it for multitenancy with IdentityServer4. One branch per tenant.
The problem I have is that I want to create new tenants dynamically without restarting the app.
For example, if I want to add new branches with newly created tenants every 15s, I could do something like this:
But this doesn't seem to work.
If I do this on startup without the Task.Run/while(true)/Task.Delay, it works.
Any idea?
Thanks!
The text was updated successfully, but these errors were encountered: