mirror of
https://github.com/aljazceru/BTCPayServerPlugins.git
synced 2026-02-19 14:44:20 +01:00
load discovered coordinators on startup
This commit is contained in:
@@ -13,7 +13,7 @@
|
||||
<PropertyGroup>
|
||||
<Product>Wabisabi Coinjoin</Product>
|
||||
<Description>Allows you to integrate your btcpayserver store with coinjoins.</Description>
|
||||
<Version>1.0.38</Version>
|
||||
<Version>1.0.39</Version>
|
||||
</PropertyGroup>
|
||||
|
||||
<!-- Plugin development properties -->
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Net.Http;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
@@ -174,7 +175,14 @@ public class WabisabiCoordinatorService : PeriodicRunner
|
||||
_httpClientFactory);
|
||||
HostedServices.Register<WabiSabiCoordinator>(() => WabiSabiCoordinator, "WabiSabi Coordinator");
|
||||
var settings = await GetSettings();
|
||||
if (settings.Enabled is true)
|
||||
if (settings.DiscoveredCoordinators?.Any() is true)
|
||||
{
|
||||
foreach (var discoveredCoordinator in settings.DiscoveredCoordinators)
|
||||
{
|
||||
_instanceManager.AddCoordinator(discoveredCoordinator.Name, discoveredCoordinator.Name, _ => discoveredCoordinator.Uri );
|
||||
}
|
||||
}
|
||||
if (settings.Enabled)
|
||||
{
|
||||
_ = StartCoordinator(cancellationToken);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user