public void StopRegularUpdate() { if (Timer_regularUpdate == null) { return; } Timer_regularUpdate.Stop(); Timer_regularUpdate.Elapsed -= RegularUpdate; Timer_regularUpdate = null; }
private void RegularUpdate(object sender, EventArgs e) { Timer_regularUpdate.Interval = 1000.0 * 60 * 30; Timer_regularUpdate.Stop(); try { //UpdateAllSubscription(); //todo 暂时关闭自动更新 foreach (var server in configs) { server.TcpingLatency(); } Thread.Sleep(1000 * 60 * 30); } catch (Exception) { } Timer_regularUpdate.Start(); }
private void RegularUpdate(object sender, EventArgs e) { Timer_regularUpdate.Interval = 1000.0 * 60 * (30 + configs.Count / 2); Timer_regularUpdate.Stop(); try { //UpdateAllSubscription(); //不再自动更新订阅 foreach (var server in configs) { server.TcpingLatency(); } Thread.Sleep(1000 * 60 * 30); } catch (Exception) { } if (Timer_regularUpdate != null) { Timer_regularUpdate.Start(); } }