| 123456789101112131415161718192021222324252627282930313233 |
- using System.Collections.Generic;
- using System.Threading;
- using MySystem;
- public class GetSpTimer
- {
- public readonly static GetSpTimer Instance = new GetSpTimer();
- private GetSpTimer()
- { }
- public void Start()
- {
- List<JobMqMsg> list = RedisDbconn.Instance.GetList<JobMqMsg>("GetSpData", 1, 1000);
- foreach(JobMqMsg sub in list)
- {
- Thread th = new Thread(DoWorks);
- th.IsBackground = true;
- th.Start(sub);
- }
- }
- //核对执行结果,并保存数据
- public void DoWorks(object sender)
- {
- // string content = sender.ToString();
- // if (!string.IsNullOrEmpty(content))
- // {
- // JobMqMsg job = Newtonsoft.Json.JsonConvert.DeserializeObject<JobMqMsg>(content);
- JobMqMsg job = (JobMqMsg)sender;
- PublicImportDataService.Instance.Start(job);
- // }
- }
- }
|