fix(shadow): start queue cursor at database time
This commit is contained in:
@@ -69,7 +69,7 @@ public final class SqlServerShadowFactReader {
|
||||
}
|
||||
try {
|
||||
ShadowFactBatch batch = sourceTransaction.execute(status ->
|
||||
collect(cursor.withOverlap(CURSOR_OVERLAP), deadline));
|
||||
collect(cursor, deadline));
|
||||
if (batch == null) {
|
||||
throw new ShadowFactReadException("SOURCE_EMPTY_BATCH",
|
||||
Duration.ZERO);
|
||||
@@ -94,7 +94,11 @@ public final class SqlServerShadowFactReader {
|
||||
private ShadowFactBatch collect(ShadowReadCursor cursor, Instant deadline) {
|
||||
ensureTime(deadline);
|
||||
Instant databaseStartedAt = source.readDatabaseClock(deadline);
|
||||
List<ShadowQueueFact> queues = immutable(source.readQueues(cursor, deadline));
|
||||
ShadowReadCursor queryCursor = cursor.isInitial()
|
||||
? new ShadowReadCursor(databaseStartedAt, "") : cursor;
|
||||
queryCursor = queryCursor.withOverlap(CURSOR_OVERLAP);
|
||||
List<ShadowQueueFact> queues = immutable(source.readQueues(
|
||||
queryCursor, deadline));
|
||||
requireLimit("QUEUE", queues.size(), QUEUE_LIMIT);
|
||||
List<ShadowVehicleFact> vehicles =
|
||||
immutable(source.readVehicles(deadline));
|
||||
|
||||
Reference in New Issue
Block a user