Adjustments to automatically update GEO files

This commit is contained in:
2dust 2024-09-27 09:58:09 +08:00
parent 60a75d9a31
commit 8e02394ff4

View file

@ -12,7 +12,7 @@
public void RegUpdateTask(Config config, Action<bool, string> update) public void RegUpdateTask(Config config, Action<bool, string> update)
{ {
Task.Run(() => UpdateTaskRunSubscription(config, 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) private async Task UpdateTaskRunSubscription(Config config, Action<bool, string> update)
@ -50,12 +50,14 @@
{ {
var autoUpdateGeoTime = DateTime.Now; var autoUpdateGeoTime = DateTime.Now;
await Task.Delay(1000 * 120); //await Task.Delay(1000 * 120);
Logging.SaveLog("UpdateTaskRunGeo"); Logging.SaveLog("UpdateTaskRunGeo");
var updateHandle = new UpdateHandler(); var updateHandle = new UpdateHandler();
while (true) while (true)
{ {
await Task.Delay(1000 * 3600);
var dtNow = DateTime.Now; var dtNow = DateTime.Now;
if (config.guiItem.autoUpdateInterval > 0) if (config.guiItem.autoUpdateInterval > 0)
{ {
@ -68,8 +70,6 @@
autoUpdateGeoTime = dtNow; autoUpdateGeoTime = dtNow;
} }
} }
await Task.Delay(1000 * 3600);
} }
} }
} }