mirror of
https://github.com/2dust/v2rayN.git
synced 2025-10-19 23:04:40 +00:00
Optimization and improvement
This commit is contained in:
parent
f39bc6d3b0
commit
3555d861ae
1 changed files with 25 additions and 5 deletions
|
@ -26,15 +26,29 @@ public class TaskManager
|
||||||
await Task.Delay(1000 * 60);
|
await Task.Delay(1000 * 60);
|
||||||
|
|
||||||
//Execute once 1 minute
|
//Execute once 1 minute
|
||||||
await UpdateTaskRunSubscription();
|
try
|
||||||
|
{
|
||||||
|
await UpdateTaskRunSubscription();
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Logging.SaveLog("ScheduledTasks - UpdateTaskRunSubscription", ex);
|
||||||
|
}
|
||||||
|
|
||||||
//Execute once 20 minute
|
//Execute once 20 minute
|
||||||
if (numOfExecuted % 20 == 0)
|
if (numOfExecuted % 20 == 0)
|
||||||
{
|
{
|
||||||
//Logging.SaveLog("Execute save config");
|
//Logging.SaveLog("Execute save config");
|
||||||
|
|
||||||
await ConfigHandler.SaveConfig(_config);
|
try
|
||||||
await ProfileExManager.Instance.SaveTo();
|
{
|
||||||
|
await ConfigHandler.SaveConfig(_config);
|
||||||
|
await ProfileExManager.Instance.SaveTo();
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Logging.SaveLog("ScheduledTasks - SaveConfig", ex);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//Execute once 1 hour
|
//Execute once 1 hour
|
||||||
|
@ -46,8 +60,14 @@ public class TaskManager
|
||||||
FileManager.DeleteExpiredFiles(Utils.GetLogPath(), DateTime.Now.AddMonths(-1));
|
FileManager.DeleteExpiredFiles(Utils.GetLogPath(), DateTime.Now.AddMonths(-1));
|
||||||
FileManager.DeleteExpiredFiles(Utils.GetTempPath(), DateTime.Now.AddMonths(-1));
|
FileManager.DeleteExpiredFiles(Utils.GetTempPath(), DateTime.Now.AddMonths(-1));
|
||||||
|
|
||||||
//Check once 1 hour
|
try
|
||||||
await UpdateTaskRunGeo(numOfExecuted / 60);
|
{
|
||||||
|
await UpdateTaskRunGeo(numOfExecuted / 60);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Logging.SaveLog("ScheduledTasks - UpdateTaskRunGeo", ex);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
numOfExecuted++;
|
numOfExecuted++;
|
||||||
|
|
Loading…
Reference in a new issue