From a13d17161bdb1dd450ce4260839116bdeae85d86 Mon Sep 17 00:00:00 2001 From: John Simons Date: Mon, 10 Mar 2025 16:31:11 +1000 Subject: [PATCH] Add from to get query too --- .../Throughput/LicensingDataStore.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/ServiceControl.Persistence.RavenDB/Throughput/LicensingDataStore.cs b/src/ServiceControl.Persistence.RavenDB/Throughput/LicensingDataStore.cs index 8b2183cd66..6da42ddc8d 100644 --- a/src/ServiceControl.Persistence.RavenDB/Throughput/LicensingDataStore.cs +++ b/src/ServiceControl.Persistence.RavenDB/Throughput/LicensingDataStore.cs @@ -127,9 +127,10 @@ public async Task>> GetEndpointT var store = await storeProvider.GetDocumentStore(cancellationToken); using IAsyncDocumentSession session = store.OpenAsyncSession(databaseConfiguration.Name); + var from = DateTime.UtcNow.AddMonths(-14); var query = session.Query() .Where(document => document.SanitizedName.In(queueNames)) - .Include(builder => builder.IncludeTimeSeries(ThroughputTimeSeriesName, DateTime.UtcNow.AddMonths(-14))); + .Include(builder => builder.IncludeTimeSeries(ThroughputTimeSeriesName, from)); var documents = await query.ToListAsync(cancellationToken); @@ -137,7 +138,7 @@ public async Task>> GetEndpointT { var timeSeries = await session .IncrementalTimeSeriesFor(document.GenerateDocumentId(), ThroughputTimeSeriesName) - .GetAsync(token: cancellationToken); + .GetAsync(from, token: cancellationToken); if (results.TryGetValue(document.SanitizedName, out var throughputDatas) && throughputDatas is List throughputDataList)