Updated with Antigravity.
This commit is contained in:
@@ -184,14 +184,15 @@ public static class NodeEndpoints
|
||||
db.NodeKeys.Add(nodeKey);
|
||||
await db.SaveChangesAsync();
|
||||
|
||||
// Broadcast change to other servers in background
|
||||
_ = Task.Run(async () =>
|
||||
{
|
||||
try
|
||||
{
|
||||
using var scope = context.RequestServices.CreateScope();
|
||||
var scopeDb = scope.ServiceProvider.GetRequiredService<ServerDbContext>();
|
||||
await SyncEndpoints.BroadcastNodeChangeAsync(uuid, scopeDb, peerCache, certManager, httpClient);
|
||||
var rsaKeyManager = scope.ServiceProvider.GetRequiredService<RsaKeyManager>();
|
||||
var configuration = scope.ServiceProvider.GetRequiredService<IConfiguration>();
|
||||
await SyncEndpoints.BroadcastNodeChangeAsync(uuid, scopeDb, peerCache, rsaKeyManager, configuration, httpClient);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@@ -261,14 +262,15 @@ public static class NodeEndpoints
|
||||
node.UpdatedAt = DateTime.UtcNow;
|
||||
await db.SaveChangesAsync();
|
||||
|
||||
// Broadcast change to other servers in background
|
||||
_ = Task.Run(async () =>
|
||||
{
|
||||
try
|
||||
{
|
||||
using var scope = context.RequestServices.CreateScope();
|
||||
var scopeDb = scope.ServiceProvider.GetRequiredService<ServerDbContext>();
|
||||
await SyncEndpoints.BroadcastNodeChangeAsync(uuid, scopeDb, peerCache, certManager, httpClient);
|
||||
var rsaKeyManager = scope.ServiceProvider.GetRequiredService<RsaKeyManager>();
|
||||
var configuration = scope.ServiceProvider.GetRequiredService<IConfiguration>();
|
||||
await SyncEndpoints.BroadcastNodeChangeAsync(uuid, scopeDb, peerCache, rsaKeyManager, configuration, httpClient);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@@ -300,14 +302,15 @@ public static class NodeEndpoints
|
||||
node.UpdatedAt = DateTime.UtcNow;
|
||||
await db.SaveChangesAsync();
|
||||
|
||||
// Broadcast change to other servers in background
|
||||
_ = Task.Run(async () =>
|
||||
{
|
||||
try
|
||||
{
|
||||
using var scope = context.RequestServices.CreateScope();
|
||||
var scopeDb = scope.ServiceProvider.GetRequiredService<ServerDbContext>();
|
||||
await SyncEndpoints.BroadcastNodeChangeAsync(uuid, scopeDb, peerCache, certManager, httpClient);
|
||||
var rsaKeyManager = scope.ServiceProvider.GetRequiredService<RsaKeyManager>();
|
||||
var configuration = scope.ServiceProvider.GetRequiredService<IConfiguration>();
|
||||
await SyncEndpoints.BroadcastNodeChangeAsync(uuid, scopeDb, peerCache, rsaKeyManager, configuration, httpClient);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user