Skip to content

Commit

Permalink
Merge pull request #912 from alphagov/pp_7018_remove_csv_limit
Browse files Browse the repository at this point in the history
PP-7018 Remove limit for CSV transactions
  • Loading branch information
kbottla authored Sep 7, 2020
2 parents 45280bd + 9de7e5d commit 1f4e3cb
Show file tree
Hide file tree
Showing 5 changed files with 76 additions and 11 deletions.
75 changes: 75 additions & 0 deletions .secrets.baseline
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
{
"exclude": {
"files": null,
"lines": null
},
"generated_at": "2020-09-04T13:50:13Z",
"plugins_used": [
{
"name": "AWSKeyDetector"
},
{
"name": "ArtifactoryDetector"
},
{
"base64_limit": 4.5,
"name": "Base64HighEntropyString"
},
{
"name": "BasicAuthDetector"
},
{
"name": "CloudantDetector"
},
{
"hex_limit": 3,
"name": "HexHighEntropyString"
},
{
"name": "IbmCloudIamDetector"
},
{
"name": "IbmCosHmacDetector"
},
{
"name": "JwtTokenDetector"
},
{
"keyword_exclude": null,
"name": "KeywordDetector"
},
{
"name": "MailchimpDetector"
},
{
"name": "PrivateKeyDetector"
},
{
"name": "SlackDetector"
},
{
"name": "SoftlayerDetector"
},
{
"name": "StripeDetector"
},
{
"name": "TwilioKeyDetector"
}
],
"results": {
"dev.yml": [
{
"hashed_secret": "08cd923367890009657eab812753379bdb321eeb",
"is_verified": true,
"line_number": 2,
"type": "Secret Keyword"
}
]
},
"version": "0.13.1",
"word_list": {
"file": null,
"hash": null
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,12 @@
import io.dropwizard.Configuration;

import javax.validation.Valid;
import javax.validation.constraints.NotNull;

public class ReportingConfig extends Configuration {

@Valid
private int maximumCsvRowsSize;

@Valid
private int streamingCsvPageSize;

public int getMaximumCsvRowsSize() {
return maximumCsvRowsSize;
}

public int getStreamingCsvPageSize() {
return streamingCsvPageSize;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ public Response streamCsv(@Valid @BeanParam TransactionSearchParams searchParams
);
outputStream.flush();
}
} while (!page.isEmpty() && count < configuration.getReportingConfig().getMaximumCsvRowsSize());
} while (!page.isEmpty());
outputStream.close();
long elapsed = stopwatch.stop().elapsed(TimeUnit.MILLISECONDS);
LOGGER.info("CSV stream took:",
Expand Down
1 change: 0 additions & 1 deletion src/main/resources/config/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,5 +76,4 @@ queueMessageReceiverConfig:
messageRetryDelayInSeconds: ${QUEUE_MESSAGE_RETRY_DELAY_IN_SECONDS:-900}

reportingConfig:
maximumCsvRowsSize: ${REPORTING_MAX_CSV_ROWS_SIZE:-100000}
streamingCsvPageSize: ${STREAMING_CSV_PAGE_SIZE:-5000}
1 change: 0 additions & 1 deletion src/test/resources/config/test-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,5 +62,4 @@ queueMessageReceiverConfig:
messageRetryDelayInSeconds: ${QUEUE_MESSAGE_RETRY_DELAY_IN_SECONDS:-900}

reportingConfig:
maximumCsvRowsSize: ${REPORTING_MAX_CSV_ROWS_SIZE:-100000}
streamingCsvPageSize: ${STREAMING_CSV_PAGE_SIZE:-5000}

0 comments on commit 1f4e3cb

Please sign in to comment.