Skip to content
This repository has been archived by the owner on Oct 26, 2023. It is now read-only.

Commit

Permalink
Merge pull request #3 from nhsuk/feature/error-details
Browse files Browse the repository at this point in the history
ℹ️ add error details to summary, tidy summary output
  • Loading branch information
st3v3nhunt committed Apr 26, 2018
2 parents f811545 + 76e400b commit 63b21eb
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
language: node_js
node_js: node
node_js: "9"
cache: yarn

before_install: yarn global add greenkeeper-lockfile@1
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
0.2.0 / 2018-04-26
==================
- Add full error details to summary

0.1.1 / 2018-03-19
==================
- Expose output filename as env var
Expand Down
8 changes: 5 additions & 3 deletions lib/etlStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,13 +100,15 @@ function saveRecords() {
}

function saveSummary() {
/* eslint-disable sort-keys */
const summary = {
erroredIds: getErorredIds(),
lastWritten: (new Date()).toLocaleString(),
totalErrored: getErorredIds().length,
totalFailed: erroredIds.length,
totalScanned: ids.length,
totalErrored: getErorredIds().length,
erroredIds,
};
/* eslint-enable sort-keys */

fsHelper.saveJsonSync(summary, config.summaryFilename);
}

Expand Down
4 changes: 3 additions & 1 deletion lib/queues/populateRecordsFromIds.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ const etlStore = require('../etlStore');
const limiter = require('../utils/limiter');
const config = require('../config');

const area = 'populateRecord';

let populateRecordFromIdAction;
let hitsPerWorker;
let count = 0;
Expand All @@ -13,7 +15,7 @@ let totalRetries = 0;
let saveEvery;

function handleError(err, id) {
etlStore.addFailedId(id, err.message);
etlStore.addFailedId(id, area, err.message);
log.error(`Error processing ID ${id}: ${err}`);
}

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "etl-toolkit",
"version": "0.1.1",
"version": "0.2.0",
"description": "general components for managing the retrieval and processing of data",
"main": "etlToolkit.js",
"repository": "https://github.com/nhsuk/etl-toolkit",
Expand Down

0 comments on commit 63b21eb

Please sign in to comment.