diff --git a/src/Angor/Client/Services/NetworkService.cs b/src/Angor/Client/Services/NetworkService.cs index 7b571631..ae5653f3 100644 --- a/src/Angor/Client/Services/NetworkService.cs +++ b/src/Angor/Client/Services/NetworkService.cs @@ -9,9 +9,11 @@ namespace Angor.Client.Services { public interface INetworkService { - Task CheckServices(); + Task CheckServices(bool force = false); SettingsUrl GetPrimaryIndexer(); + SettingsUrl GetPrimaryRelay(); + List GetRelays(); } public class NetworkService : INetworkService @@ -27,13 +29,13 @@ public NetworkService(INetworkStorage networkStorage, HttpClient httpClient, ILo _logger = logger; } - public async Task CheckServices() + public async Task CheckServices(bool force = false) { var settings = _networkStorage.GetSettings(); foreach (var indexerUrl in settings.Indexers) { - if ((DateTime.UtcNow - indexerUrl.LastCheck).Minutes > 1) + if (force || (DateTime.UtcNow - indexerUrl.LastCheck).Minutes > 10) { indexerUrl.LastCheck = DateTime.UtcNow; @@ -61,7 +63,7 @@ public async Task CheckServices() foreach (var relayUrl in settings.Relays) { - if ((DateTime.UtcNow - relayUrl.LastCheck).Minutes > 1) + if (force || (DateTime.UtcNow - relayUrl.LastCheck).Minutes > 1) { relayUrl.LastCheck = DateTime.UtcNow; diff --git a/src/Angor/Client/Shared/NavMenu.razor b/src/Angor/Client/Shared/NavMenu.razor index 8a43c4ce..e59ffca6 100644 --- a/src/Angor/Client/Shared/NavMenu.razor +++ b/src/Angor/Client/Shared/NavMenu.razor @@ -101,7 +101,7 @@ // Convert the version to a string softwareVersion = version.ToString(); - _timer = new Timer(TimerElapsed, null, TimeSpan.Zero, TimeSpan.FromMinutes(1)); // Tick every 1 min + _timer = new Timer(TimerElapsed, null, TimeSpan.Zero, TimeSpan.FromMinutes(5)); // Tick every 5 min } protected override async Task OnInitializedAsync()