Skip to content

Commit 4bc81ec

Browse files
authored
Merge pull request #4866 from Particular/john/range
Add from to get query too
2 parents 037ef3b + 1b18575 commit 4bc81ec

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/ServiceControl.Persistence.RavenDB/Throughput/LicensingDataStore.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,17 +127,18 @@ public async Task<IDictionary<string, IEnumerable<ThroughputData>>> GetEndpointT
127127
var store = await storeProvider.GetDocumentStore(cancellationToken);
128128
using IAsyncDocumentSession session = store.OpenAsyncSession(databaseConfiguration.Name);
129129

130+
var from = DateTime.UtcNow.AddMonths(-14);
130131
var query = session.Query<EndpointDocument>()
131132
.Where(document => document.SanitizedName.In(queueNames))
132-
.Include(builder => builder.IncludeTimeSeries(ThroughputTimeSeriesName, DateTime.UtcNow.AddMonths(-14)));
133+
.Include(builder => builder.IncludeTimeSeries(ThroughputTimeSeriesName, from));
133134

134135
var documents = await query.ToListAsync(cancellationToken);
135136

136137
foreach (var document in documents)
137138
{
138139
var timeSeries = await session
139140
.IncrementalTimeSeriesFor(document.GenerateDocumentId(), ThroughputTimeSeriesName)
140-
.GetAsync(token: cancellationToken);
141+
.GetAsync(from, token: cancellationToken);
141142

142143
if (results.TryGetValue(document.SanitizedName, out var throughputDatas) &&
143144
throughputDatas is List<ThroughputData> throughputDataList)

0 commit comments

Comments
 (0)