-
-
Save Mats391/adf04090990012ba788cb086817c770f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void ConfigureServices(IServiceCollection services) | |
{ | |
// ... | |
services.AddTransient<IJobFactory, AspJobFactory>( | |
(provider) => | |
{ | |
return new AspJobFactory( provider ); | |
} ); | |
// Quartz jobs anhängen | |
services.AddTransient<MailImportJob>(); | |
services.AddTransient<MailSendJob>(); | |
services.AddTransient<MailReceiveJob>(); | |
// ... | |
} | |
public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory) | |
{ | |
// ... | |
app.UseQuartz( (quartz) => | |
{ | |
if (Configuration.GetValue<bool>( "Import:Active", false )) | |
quartz.AddJob<MailImportJob>( "MailImport", "Import", Configuration.GetSection( "Import" ).GetValue<int>( "Interval" ) ); | |
if (Configuration.GetValue<bool>( "Send:Active", false )) | |
quartz.AddJob<MailSendJob>( "MailSend", "Send", Configuration.GetSection( "Send" ).GetValue<int>( "Interval" ) ); | |
if (Configuration.GetValue<bool>( "Receive:Active", false )) | |
quartz.AddJob<MailReceiveJob>( "MailReceive", "Receive", Configuration.GetSection( "Receive" ).GetValue<int>( "Interval" ) ); | |
} ); | |
// ... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment