Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add NetworkMonitoringService to check Indexers and Relays in background #111

Merged
merged 22 commits into from
Jun 28, 2024

Conversation

miladsoft
Copy link
Member

No description provided.

@@ -104,6 +106,7 @@ public async Task CheckServices(bool force = false)
{
_logger.LogError($"Failed to check indexer status url = {indexerUrl.Url}, StatusCode = {response.StatusCode}");
}
OnStatusChanged?.Invoke();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting this means we don't need to wait for response it will update the page when it arrives


public async Task CheckAndEnsureServices()
{
using (var scope = _serviceProvider.CreateScope())
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

network service is scoped? how is the scoped lifetime manages in a wasm app I wonder?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Scoped: The service is created once for the duration of the user’s session in the browser. Essentially, a scoped service in Blazor WebAssembly acts as a singleton within the context of a single user's session.
This means that once a scoped service is created, it remains the same for the entirety of the user's interaction with the Blazor WebAssembly app.

There is no real point in using scoped in wasm @DavidGershony

}
catch (Exception ex)
{
Console.Error.WriteLine($"Error checking services: {ex.Message}");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

replace with logs no console

@@ -12,6 +12,7 @@

<ItemGroup>
<PackageReference Include="Blockcore.Core" Version="1.1.41" />
<PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" Version="8.0.0" />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we need Hosting.Abstractions? what component uses it?
does it mean we pull more data on load?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is related to the previous code and should be removed

@miladsoft miladsoft merged commit e90d822 into main Jun 28, 2024
4 checks passed
@miladsoft miladsoft deleted the Setting-UI/UX branch June 28, 2024 14:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Angor Indexer Offline on Initial Load
2 participants