Fall back to previously calculated totalScan

This commit is contained in:
eha sah 2025-03-11 13:13:44 -07:00
parent 4a59562cb7
commit 5ca6800085

View file

@ -622,11 +622,9 @@ public class DynamoDBLeaseRefresher implements LeaseRefresher {
if (isTotalSegmentsCacheValid()) {
return cachedTotalSegments;
}
int parallelScanTotalSegments = DEFAULT_LEASE_TABLE_SCAN_PARALLELISM_FACTOR;
if (isTotalSegmentsCacheValid()) {
return cachedTotalSegments;
}
DescribeTableResponse describeTableResponse = describeLeaseTable();
int parallelScanTotalSegments = cachedTotalSegments == null ? DEFAULT_LEASE_TABLE_SCAN_PARALLELISM_FACTOR : cachedTotalSegments;
final DescribeTableResponse describeTableResponse = describeLeaseTable();
if (describeTableResponse == null) {
log.info("DescribeTable returned null so using default totalSegments : {}", parallelScanTotalSegments);
} else {