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 list = RedisDbconn.Instance.GetList("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(content); JobMqMsg job = (JobMqMsg)sender; PublicImportDataService.Instance.Start(job); // } } }