-
Notifications
You must be signed in to change notification settings - Fork 8
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
Conversation
@@ -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(); |
There was a problem hiding this comment.
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()) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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}"); |
There was a problem hiding this comment.
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
src/Angor/Shared/Angor.Shared.csproj
Outdated
@@ -12,6 +12,7 @@ | |||
|
|||
<ItemGroup> | |||
<PackageReference Include="Blockcore.Core" Version="1.1.41" /> | |||
<PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" Version="8.0.0" /> |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
No description provided.