Base solution for your next web application
Open Closed

Timeout issue while seeding the tenant #3987


User avatar
0
pankajmathur created

We are facing an issue that the system throws timeout when seeding a tenant, in MVC 5.X we have specified the timeout in the Configuration class of the EntityFramework project

    public Configuration()
    {
        AutomaticMigrationsEnabled = false;
        ContextKey = "ManagementConsoleWeb";
        CommandTimeout = 1000;
    }

How can we achieve the same in the .Net Core 2.0.


2 Answer(s)
  • User Avatar
    0
    aaron created
    Support Team

    Try this:

    public class MyDbContext : AbpZeroDbContext<Tenant, Role, User, MyDbContext>, IAbpPersistedGrantDbContext
    {
        public MyDbContext(DbContextOptions<MyDbContext> options)
            : base(options)
        {
            Database.SetCommandTimeout(10); // seconds
        }
    }
    
  • User Avatar
    0
    pankajmathur created

    Thanks aaron...