Browse Source

Clean unused code and format code.

pull/4021/head
Halil İbrahim Kalkan 6 years ago
parent
commit
81193a261b
  1. 12
      framework/src/Volo.Abp.BackgroundJobs.Quartz/Volo/Abp/BackgroundJobs/Quartz/QuartzBackgroundJobManager.cs
  2. 9
      modules/background-jobs/app/Volo.Abp.BackgroundJobs.DemoApp.HangFire/DemoAppHangfireModule.cs
  3. 15
      modules/background-jobs/app/Volo.Abp.BackgroundJobs.DemoApp.Quartz/DemoAppQuartzModule.cs
  4. 13
      modules/background-jobs/app/Volo.Abp.BackgroundJobs.DemoApp.RabbitMq/DemoAppRabbitMqModule.cs

12
framework/src/Volo.Abp.BackgroundJobs.Quartz/Volo/Abp/BackgroundJobs/Quartz/QuartzBackgroundJobManager.cs

@ -8,15 +8,15 @@ namespace Volo.Abp.BackgroundJobs.Quartz
{ {
[Dependency(ReplaceServices = true)] [Dependency(ReplaceServices = true)]
public class QuartzBackgroundJobManager : IBackgroundJobManager, ITransientDependency public class QuartzBackgroundJobManager : IBackgroundJobManager, ITransientDependency
{ {
public const string JobDataPrefix = "Abp"; public const string JobDataPrefix = "Abp";
public const string RetryIndex = "RetryIndex"; public const string RetryIndex = "RetryIndex";
protected IScheduler Scheduler { get; } protected IScheduler Scheduler { get; }
protected AbpBackgroundJobQuartzOptions Options { get; } protected AbpBackgroundJobQuartzOptions Options { get; }
public QuartzBackgroundJobManager(IScheduler scheduler, IOptions<AbpBackgroundJobQuartzOptions> options)
public QuartzBackgroundJobManager(IScheduler scheduler,IOptions<AbpBackgroundJobQuartzOptions> options)
{ {
Scheduler = scheduler; Scheduler = scheduler;
Options = options.Value; Options = options.Value;
@ -38,7 +38,7 @@ namespace Volo.Abp.BackgroundJobs.Quartz
{JobDataPrefix+ nameof(Options.RetryIntervalMillisecond), retryIntervalMillisecond}, {JobDataPrefix+ nameof(Options.RetryIntervalMillisecond), retryIntervalMillisecond},
{JobDataPrefix+ RetryIndex, 0} {JobDataPrefix+ RetryIndex, 0}
}; };
var jobDetail = JobBuilder.Create<QuartzJobExecutionAdapter<TArgs>>().RequestRecovery().SetJobData(jobDataMap).Build(); var jobDetail = JobBuilder.Create<QuartzJobExecutionAdapter<TArgs>>().RequestRecovery().SetJobData(jobDataMap).Build();
var trigger = !delay.HasValue ? TriggerBuilder.Create().StartNow().Build() : TriggerBuilder.Create().StartAt(new DateTimeOffset(DateTime.Now.Add(delay.Value))).Build(); var trigger = !delay.HasValue ? TriggerBuilder.Create().StartNow().Build() : TriggerBuilder.Create().StartAt(new DateTimeOffset(DateTime.Now.Add(delay.Value))).Build();
await Scheduler.ScheduleJob(jobDetail, trigger); await Scheduler.ScheduleJob(jobDetail, trigger);

9
modules/background-jobs/app/Volo.Abp.BackgroundJobs.DemoApp.HangFire/DemoAppHangfireModule.cs

@ -24,14 +24,5 @@ namespace Volo.Abp.BackgroundJobs.DemoApp.HangFire
hangfireConfiguration.UseSqlServerStorage(configuration.GetConnectionString("Default")); hangfireConfiguration.UseSqlServerStorage(configuration.GetConnectionString("Default"));
}); });
} }
public override void OnApplicationInitialization(ApplicationInitializationContext context)
{
//TODO: Configure console logging
//context
// .ServiceProvider
// .GetRequiredService<ILoggerFactory>()
// .AddConsole(LogLevel.Debug);
}
} }
} }

15
modules/background-jobs/app/Volo.Abp.BackgroundJobs.DemoApp.Quartz/DemoAppQuartzModule.cs

@ -1,11 +1,7 @@
using System.Collections.Specialized; using Volo.Abp.Autofac;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.Autofac;
using Volo.Abp.BackgroundJobs.DemoApp.Shared; using Volo.Abp.BackgroundJobs.DemoApp.Shared;
using Volo.Abp.BackgroundJobs.Quartz; using Volo.Abp.BackgroundJobs.Quartz;
using Volo.Abp.Modularity; using Volo.Abp.Modularity;
using Volo.Abp.Quartz;
namespace Volo.Abp.BackgroundJobs.DemoApp.Quartz namespace Volo.Abp.BackgroundJobs.DemoApp.Quartz
{ {
@ -16,13 +12,6 @@ namespace Volo.Abp.BackgroundJobs.DemoApp.Quartz
)] )]
public class DemoAppQuartzModule : AbpModule public class DemoAppQuartzModule : AbpModule
{ {
public override void OnApplicationInitialization(ApplicationInitializationContext context)
{
//TODO: Configure console logging
//context
// .ServiceProvider
// .GetRequiredService<ILoggerFactory>()
// .AddConsole(LogLevel.Debug);
}
} }
} }

13
modules/background-jobs/app/Volo.Abp.BackgroundJobs.DemoApp.RabbitMq/DemoAppRabbitMqModule.cs

@ -1,6 +1,4 @@
using Microsoft.Extensions.DependencyInjection; using Volo.Abp.Autofac;
using Microsoft.Extensions.Logging;
using Volo.Abp.Autofac;
using Volo.Abp.BackgroundJobs.DemoApp.Shared; using Volo.Abp.BackgroundJobs.DemoApp.Shared;
using Volo.Abp.BackgroundJobs.RabbitMQ; using Volo.Abp.BackgroundJobs.RabbitMQ;
using Volo.Abp.Modularity; using Volo.Abp.Modularity;
@ -14,13 +12,6 @@ namespace Volo.Abp.BackgroundJobs.DemoApp.RabbitMq
)] )]
public class DemoAppRabbitMqModule : AbpModule public class DemoAppRabbitMqModule : AbpModule
{ {
public override void OnApplicationInitialization(ApplicationInitializationContext context)
{
//TODO: Configure console logging
//context
// .ServiceProvider
// .GetRequiredService<ILoggerFactory>()
// .AddConsole(LogLevel.Debug);
}
} }
} }

Loading…
Cancel
Save