every 3 hours UpdateSubscriptionRememberChoice.

This commit is contained in:
JaredDC 2021-06-30 17:38:17 +08:00
parent 1dbc3118d9
commit 8be8e33330

View file

@ -32,11 +32,18 @@ namespace v2rayN.Forms
HideForm(); HideForm();
this.Text = Utils.GetVersion(); this.Text = Utils.GetVersion();
Global.processJob = new Job(); Global.processJob = new Job();
Application.ApplicationExit += (sender, args) => Application.ApplicationExit += (sender, args) =>
{ {
MyAppExit(false); MyAppExit(false);
}; };
var _timer = new System.Timers.Timer();
/*_timer.Interval = 1000 * 60 * mins;*/
_timer.Interval = 1000 * 60 * 60 * 3; // every 3 hours
_timer.AutoReset = true;
_timer.Enabled = true;
_timer.Elapsed += timer_Elapsed;
_timer.Start();
} }
private void MainForm_Load(object sender, EventArgs e) private void MainForm_Load(object sender, EventArgs e)
@ -1341,6 +1348,10 @@ namespace v2rayN.Forms
UpdateSubscriptionRememberChoice(); UpdateSubscriptionRememberChoice();
} }
private void timer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
{
UpdateSubscriptionRememberChoice();
}
private void UpdateSubscriptionRememberChoice() private void UpdateSubscriptionRememberChoice()
{ {
try try