Browse Source
Merge pull request #3470 from liangshiw/liangshiwei/quartz-start-async
Start and shutdown quartz asynchronously
pull/3475/head
maliming
7 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
2 additions and
2 deletions
-
framework/src/Volo.Abp.Quartz/Volo/Abp/Quartz/AbpQuartzModule.cs
|
|
|
@ -22,13 +22,13 @@ namespace Volo.Abp.Quartz |
|
|
|
{ |
|
|
|
_scheduler = context.ServiceProvider.GetService<IScheduler>(); |
|
|
|
_scheduler.JobFactory = context.ServiceProvider.GetService<IJobFactory>(); |
|
|
|
_scheduler.Start(); |
|
|
|
AsyncHelper.RunSync(() => _scheduler.Start()); |
|
|
|
} |
|
|
|
|
|
|
|
public override void OnApplicationShutdown(ApplicationShutdownContext context) |
|
|
|
{ |
|
|
|
//TODO: ABP may provide two methods for application shutdown: OnPreApplicationShutdown & OnApplicationShutdown
|
|
|
|
_scheduler.Shutdown(); |
|
|
|
AsyncHelper.RunSync(() => _scheduler.Shutdown()); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|