using Quartz; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using XYY.Tool.QuotaReduction; namespace XYY.Tool.TimingTask.jobs { public class PushESBTrackMonitorJob : IJob { public async Task Execute(IJobExecutionContext context) { RestSharp.RestClient client = new RestSharp.RestClient(JobConfig.PushESBTrackMonitorApi); RestSharp.RestRequest request = new RestSharp.RestRequest(RestSharp.Method.GET); request.AddHeader("Authorization", "token 985833DB91DA7B38C3918D3F1F9D2339"); client.Timeout = -1; var response = client.Execute(request); if (response.StatusCode != System.Net.HttpStatusCode.OK) { string msg = "异常轨迹文件推送失败" + (response.ErrorMessage ?? response.Content); dingApiRequest.sendMessageToWeChat("PushESBTrackMonitorJob", msg, new List() { "LiuZhengKai" }); } } } }