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.
38 lines
1.2 KiB
38 lines
1.2 KiB
using Hangfire;
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
using Volo.Abp.Autofac;
|
|
using Volo.Abp.BackgroundJobs.DemoApp.Shared;
|
|
using Volo.Abp.Modularity;
|
|
using Microsoft.Extensions.Configuration;
|
|
using Volo.Abp.BackgroundJobs.Hangfire;
|
|
|
|
namespace Volo.Abp.BackgroundJobs.DemoApp.HangFire
|
|
{
|
|
[DependsOn(
|
|
typeof(DemoAppSharedModule),
|
|
typeof(AbpAutofacModule),
|
|
typeof(AbpBackgroundJobsHangfireModule)
|
|
)]
|
|
public class DemoAppHangfireModule : AbpModule
|
|
{
|
|
public override void PreConfigureServices(ServiceConfigurationContext context)
|
|
{
|
|
var configuration = context.Services.GetConfiguration();
|
|
|
|
context.Services.PreConfigure<IGlobalConfiguration>(hangfireConfiguration =>
|
|
{
|
|
hangfireConfiguration.UseSqlServerStorage(configuration.GetConnectionString("Default"));
|
|
});
|
|
}
|
|
|
|
public override void OnApplicationInitialization(ApplicationInitializationContext context)
|
|
{
|
|
//TODO: Configure console logging
|
|
//context
|
|
// .ServiceProvider
|
|
// .GetRequiredService<ILoggerFactory>()
|
|
// .AddConsole(LogLevel.Debug);
|
|
}
|
|
}
|
|
}
|