/// <summary> /// /// </summary> /// <param name="timer"></param> /// <param name="serviceScopeFactory"></param> protected AsyncPeriodicBackgroundWorkerBase( IScorpioTimer timer, IServiceScopeFactory serviceScopeFactory) { ServiceScopeFactory = serviceScopeFactory; Timer = timer; Timer.Elapsed += Timer_Elapsed; }
/// <summary> /// /// </summary> /// <param name="timer"></param> /// <param name="jobOptions"></param> /// <param name="workerOptions"></param> /// <param name="serviceScopeFactory"></param> public BackgroundJobWorker( IScorpioTimer timer, IOptions <BackgroundJobOptions> jobOptions, IOptions <BackgroundJobWorkerOptions> workerOptions, IServiceScopeFactory serviceScopeFactory) : base( timer, serviceScopeFactory) { WorkerOptions = workerOptions.Value; JobOptions = jobOptions.Value; Timer.Period = WorkerOptions.JobPollPeriod; }
public FakeAsyncPeriodicBackgroundWorkerBase(IScorpioTimer timer, IServiceScopeFactory serviceScopeFactory) : base(timer, serviceScopeFactory) { timer.Period = 3600000; timer.RunOnStart = true; }