Activities of "Anawaz"

Still same issue.

I increased the delay from 5000 to 15000 and now it is working. It seems Database was no ready before it runs dataseed. Updated code.

 private async Task MigrateAndSeedForTenantAsync(
     Guid tenantId,
     string adminEmail,
     string adminPassword)
 {
     try
     {
         using (_currentTenant.Change(tenantId))
         {
             await Task.Delay(15000);
             // Create database tables if needed
             using (var uow = _unitOfWorkManager.Begin(requiresNew: true, isTransactional: false))
             {
                 var tenantConfiguration = await _tenantStore.FindAsync(tenantId);
                 if (tenantConfiguration?.ConnectionStrings != null &&
                     !tenantConfiguration.ConnectionStrings.Default.IsNullOrWhiteSpace())
                 {
                     foreach (var migrator in _dbSchemaMigrators)
                     {
                         await migrator.MigrateAsync();
                     }
                 }

                 await uow.CompleteAsync();
             }
             await Task.Delay(15000);
             // Seed data
             using (var uow = _unitOfWorkManager.Begin(requiresNew: true, isTransactional: true))
             {
                 await _dataSeeder.SeedAsync(
                     new DataSeedContext(tenantId)
                         .WithProperty(IdentityDataSeedContributor.AdminEmailPropertyName, adminEmail)
                         .WithProperty(IdentityDataSeedContributor.AdminPasswordPropertyName, adminPassword)
                 );

                 await uow.CompleteAsync();
             }
         }
     }
     catch (Exception ex)
     {
         _logger.LogException(ex);
     }
 }
Showing 1 to 2 of 2 entries
Learn More, Pay Less
33% OFF
All Trainings!
Get Your Deal
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v10.0.0-preview. Updated on September 08, 2025, 09:55