Skip to content
Permalink
Browse files

Add additional logging during data processing

  • Loading branch information
KevinCaseiras committed Dec 6, 2019
1 parent 0edfa26 commit 46d688551a1ceb978b8decd5b066d6120db5fea1
Showing with 8 additions and 2 deletions.
  1. +8 −2 src/main/java/gov/nysenate/openleg/processor/DataProcessor.java
@@ -86,6 +86,7 @@ public synchronized DataProcessRun run(String invoker, boolean async) throws Exc
asyncUtils.run(this::doRun);
} else {
doRun();
logger.info("Data processor has completed.");
}

return currentRun;
@@ -151,12 +152,14 @@ public synchronized void collate() {
Map<String, Integer> collatedCounts = new LinkedHashMap<>();
for (ProcessService processor : processServices) {
if (env.isProcessingEnabled()) {
logger.info("Collating " + processor.getCollateType());
int collatedCount = processor.collate();
if (collatedCount > 0) {
collatedCounts.put(processor.getCollateType(), collatedCount);
}
} else {
logger.info("Not collating data, processing is disabled.");
}

}
if (collatedCounts.size() > 0) {
logger.debug("Completed collations:");
@@ -168,14 +171,17 @@ public synchronized void collate() {
}

public synchronized void ingest() throws IOException {
logger.debug("Begin ingesting data");
logger.info("Begin ingesting data");
Map<String, Integer> ingestedCounts = new LinkedHashMap<>();
for (ProcessService processor : processServices) {
if (env.isProcessingEnabled()) {
logger.info("Ingesting " + processor.getIngestType());
int ingestedCount = processor.ingest();
if (ingestedCount > 0) {
ingestedCounts.put(processor.getIngestType(), ingestedCount);
}
} else {
logger.info("Not injesting data, processing is disabled.");
}
}
if (ingestedCounts.size() > 0) {

0 comments on commit 46d6885

Please sign in to comment.
You can’t perform that action at this time.