Skip to content

Commit 1387c1b

Browse files
committed
Remove connectapplications
We replacing it with a specific implementation
1 parent adf62c4 commit 1387c1b

23 files changed

+23
-165
lines changed

src/ServiceControl.Persistence.RavenDB/ConnectedApplicationsDataStore.cs

Lines changed: 0 additions & 28 deletions
This file was deleted.

src/ServiceControl.Persistence.RavenDB/EndpointDetailsParser.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ public static EndpointDetails ReceivingEndpoint(IReadOnlyDictionary<string, stri
8080
}
8181

8282
// If we've been now able to get the endpoint details, return the new info.
83-
if (!string.IsNullOrEmpty(endpoint.Name))
83+
if (!string.IsNullOrEmpty(endpoint.Name) && !string.IsNullOrEmpty(endpoint.Host))
8484
{
8585
return endpoint;
8686
}

src/ServiceControl.Persistence.RavenDB/RavenMonitoringDataStore.cs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
{
33
using System;
44
using System.Collections.Generic;
5-
using System.Linq;
65
using System.Threading.Tasks;
76
using Raven.Client.Documents;
87
using ServiceControl.Operations;
@@ -87,17 +86,12 @@ public async Task WarmupMonitoringFromPersistence(IEndpointInstanceMonitoring en
8786
{
8887
using var session = await sessionProvider.OpenSession();
8988
await using var endpointsEnumerator = await session.Advanced.StreamAsync(session.Query<KnownEndpoint, KnownEndpointIndex>());
90-
var connectedApplications = await session.Advanced.LoadStartingWithAsync<ConnectedApplication>(ConnectedApplication.CollectionName, pageSize: 1024);
9189

9290
while (await endpointsEnumerator.MoveNextAsync())
9391
{
9492
var endpoint = endpointsEnumerator.Current.Document;
9593

96-
endpointInstanceMonitoring.DetectEndpointFromPersistentStore(
97-
endpoint.EndpointDetails,
98-
endpoint.Monitored,
99-
connectedApplications.SingleOrDefault(ca => ConnectedApplication.MakeDocumentId(ca.Name) == endpoint.EndpointDetails.ConnectedApplicationId)?.SupportsHeartbeats ?? true
100-
);
94+
endpointInstanceMonitoring.DetectEndpointFromPersistentStore(endpoint.EndpointDetails, endpoint.Monitored);
10195
}
10296
}
10397

src/ServiceControl.Persistence.RavenDB/RavenPersistence.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ public void AddPersistence(IServiceCollection services)
6666
services.AddSingleton<IRetryHistoryDataStore, RetryHistoryDataStore>();
6767
services.AddSingleton<IEndpointSettingsStore, EndpointSettingsStore>();
6868
services.AddSingleton<ITrialLicenseDataProvider, TrialLicenseDataProvider>();
69-
services.AddSingleton<IConnectedApplicationsDataStore, ConnectedApplicationsDataStore>();
7069
}
7170

7271
public void AddInstaller(IServiceCollection services)

src/ServiceControl.Persistence.Tests.RavenDB/ConnectedApplications/ConnectedApplicationsTests.cs

Lines changed: 0 additions & 35 deletions
This file was deleted.

src/ServiceControl.Persistence/ConnectedApplication.cs

Lines changed: 0 additions & 13 deletions
This file was deleted.

src/ServiceControl.Persistence/EndpointDetails.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ public class EndpointDetails
1111

1212
public string Host { get; set; }
1313

14-
public string ConnectedApplicationId { get; set; }
15-
1614
public Guid GetDeterministicId() => DeterministicGuid.MakeId(Name, HostId.ToString());
1715
}
1816
}

src/ServiceControl.Persistence/EndpointInstanceId.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,12 @@ namespace ServiceControl.Persistence
55

66
public class EndpointInstanceId : IEquatable<EndpointInstanceId>
77
{
8-
public EndpointInstanceId(string logicalName, string hostName, Guid hostGuid, bool supportsHeartbeats)
8+
public EndpointInstanceId(string logicalName, string hostName, Guid hostGuid)
99
{
1010
LogicalName = logicalName;
1111
HostName = hostName;
1212
HostGuid = hostGuid;
1313
UniqueId = DeterministicGuid.MakeId(LogicalName, HostGuid.ToString());
14-
SupportsHeartbeats = supportsHeartbeats;
1514
}
1615

1716
public Guid UniqueId { get; }

src/ServiceControl.Persistence/EndpointsView.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ public class EndpointsView
1010
public bool Monitored { get; set; }
1111
public bool MonitorHeartbeat { get; set; }
1212
public HeartbeatInformation HeartbeatInformation { get; set; }
13-
public bool SupportsHeartbeats { get; set; }
1413
public bool IsSendingHeartbeats { get; set; }
1514
}
1615
}

src/ServiceControl.Persistence/IConnectedApplicationsDataStore.cs

Lines changed: 0 additions & 12 deletions
This file was deleted.

0 commit comments

Comments
 (0)