mirror of https://github.com/abpframework/abp
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
49 lines
1.4 KiB
49 lines
1.4 KiB
using System.Threading.Tasks;
|
|
using Volo.Abp.Autofac;
|
|
using Volo.Abp.BackgroundJobs.DemoApp.Shared;
|
|
using Volo.Abp.BackgroundJobs.EntityFrameworkCore;
|
|
using Volo.Abp.EntityFrameworkCore;
|
|
using Volo.Abp.EntityFrameworkCore.SqlServer;
|
|
using Volo.Abp.Modularity;
|
|
|
|
namespace Volo.Abp.BackgroundJobs.DemoApp;
|
|
|
|
[DependsOn(
|
|
typeof(DemoAppSharedModule),
|
|
typeof(AbpBackgroundJobsEntityFrameworkCoreModule),
|
|
typeof(AbpAutofacModule),
|
|
typeof(AbpEntityFrameworkCoreSqlServerModule)
|
|
)]
|
|
public class DemoAppModule : AbpModule
|
|
{
|
|
public override void ConfigureServices(ServiceConfigurationContext context)
|
|
{
|
|
Configure<AbpDbContextOptions>(options =>
|
|
{
|
|
options.Configure(opts =>
|
|
{
|
|
opts.UseSqlServer();
|
|
});
|
|
});
|
|
|
|
Configure<AbpBackgroundJobWorkerOptions>(options =>
|
|
{
|
|
//Configure for fast running
|
|
options.JobPollPeriod = 1000;
|
|
options.DefaultFirstWaitDuration = 1;
|
|
options.DefaultWaitFactor = 1;
|
|
});
|
|
}
|
|
|
|
public override Task OnApplicationInitializationAsync(ApplicationInitializationContext context)
|
|
{
|
|
//TODO: Configure console logging
|
|
//context
|
|
// .ServiceProvider
|
|
// .GetRequiredService<ILoggerFactory>()
|
|
// .AddConsole(LogLevel.Debug);
|
|
|
|
return Task.CompletedTask;
|
|
}
|
|
}
|