public void Start(out string errMsg) { errMsg = ""; if (IsRuning) { return; } LoadConfig(); WebPandaPumpCommand.CreateInitPumpRealData(Config.param).Execute(); //初始化实时表 timer = new System.Timers.Timer(); timer.Interval = collectInterval * 60 * 1000; timer.Elapsed += (o, e) => { try { ReceiveCommand(new RequestCommand()); } catch (Exception ee) { TraceManagerForWeb.AppendErrMsg("二供-WEB 定时任务执行失败:" + ee.Message); } }; timer.Enabled = true; IsRuning = true; // 开始异步执行一次-防止启动卡死 Action <RequestCommand> action = ReceiveCommand; action.BeginInvoke(new RequestCommand(), null, null); }
private void ExcuteHandle() { // 报警维护 WebPandaPumpCommand.CreateCollectAndSavePumpPoints(Config.param).Execute(); }