-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUpdateJob.cs
More file actions
34 lines (32 loc) · 1.06 KB
/
UpdateJob.cs
File metadata and controls
34 lines (32 loc) · 1.06 KB
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
using CoreduinoNet_DDNS.Tools;
using log4net;
using Quartz;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CoreduinoNet_DDNS
{
public class UpdateJob : IJob
{
private readonly ILog _log = LogManager.GetLogger(typeof(UpdateJob));
// 作业
public async Task Execute(IJobExecutionContext context)
{
JobDataMap dataMap = context.JobDetail.JobDataMap;
string time = DateTime.Now.ToString();
_log.Debug("[" + time + "]" + "[调试]");
_log.Error("[" + time + "]" + "[错误]");
_log.Info("[" + time + "]" + "[信息]");
// 任务
Console.WriteLine("[信息] 已开始更新");
DateTime beforDT = DateTime.Now;
ddns.DDNSCNN.check();
ddns.DDNSCNN.update();
DateTime afterDT = DateTime.Now;
TimeSpan times = afterDT.Subtract(beforDT);
Console.WriteLine("[信息] 更新结束,用时{0}", times);
}
}
}