-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathProgram.cs
executable file
·49 lines (42 loc) · 1.27 KB
/
Program.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
using System;
using System.Threading.Tasks;
using System.Collections.Specialized;
using Quartz;
using Quartz.Impl;
using System.Collections.Generic;
using System.Configuration;
using System.Reflection;
using HeyTask.Config;
namespace HeyTask
{
public class Program
{
private static void Main(string[] args)
{
RunProgramRunExample().GetAwaiter().GetResult();
}
private static async Task RunProgramRunExample()
{
try
{
NameValueCollection props = new NameValueCollection
{
{ "quartz.serializer.type", "binary" }
};
StdSchedulerFactory factory = new StdSchedulerFactory(props);
IScheduler scheduler = await factory.GetScheduler();
await scheduler.Start();
foreach (var tjob in JobsConfiguration.Jobs())
{
await scheduler.ScheduleJob(tjob.Job, tjob.Trigger);
}
await Task.Delay(-1);
await scheduler.Shutdown();
}
catch (SchedulerException se)
{
Console.WriteLine(se);
}
}
}
}