Skip to content

Commit

Permalink
Adjustments to automatically update GEO files
Browse files Browse the repository at this point in the history
  • Loading branch information
2dust committed Sep 27, 2024
1 parent 60a75d9 commit 8e02394
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions v2rayN/ServiceLib/Handler/TaskHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public TaskHandler()
public void RegUpdateTask(Config config, Action<bool, string> update)
{
Task.Run(() => UpdateTaskRunSubscription(config, update));
//Task.Run(() => UpdateTaskRunGeo(config, update));
Task.Run(() => UpdateTaskRunGeo(config, update));
}

private async Task UpdateTaskRunSubscription(Config config, Action<bool, string> update)
Expand Down Expand Up @@ -50,12 +50,14 @@ private async Task UpdateTaskRunGeo(Config config, Action<bool, string> update)
{
var autoUpdateGeoTime = DateTime.Now;

await Task.Delay(1000 * 120);
//await Task.Delay(1000 * 120);
Logging.SaveLog("UpdateTaskRunGeo");

var updateHandle = new UpdateHandler();
while (true)
{
await Task.Delay(1000 * 3600);

var dtNow = DateTime.Now;
if (config.guiItem.autoUpdateInterval > 0)
{
Expand All @@ -68,8 +70,6 @@ await updateHandle.UpdateGeoFileAll(config, (bool success, string msg) =>
autoUpdateGeoTime = dtNow;
}
}

await Task.Delay(1000 * 3600);
}
}
}
Expand Down

0 comments on commit 8e02394

Please sign in to comment.