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

Commit

Permalink
🐛 Convert hash ID to value in tracking
Browse files Browse the repository at this point in the history
  • Loading branch information
AnandChowdhary committed Sep 1, 2019
1 parent 9b1a9d5 commit 14babbe
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "staart-manager",
"version": "1.1.20",
"version": "1.1.21",
"main": "index.js",
"repository": "[email protected]:AnandChowdhary/staart.git",
"author": "Anand Chowdhary <[email protected]>",
Expand Down Expand Up @@ -147,5 +147,5 @@
"setup"
],
"snyk": true,
"staart-version": "1.1.20"
"staart-version": "1.1.21"
}
11 changes: 11 additions & 0 deletions src/crons/minute.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,17 @@ const storeTrackingLogs = async () => {
day = parseInt(day) < 10 ? `0${day}` : day;
for await (const body of data) {
try {
if (typeof body === "object") {
Object.keys(body).forEach(key => {
if (IdValues.includes(key)) body[key] = hashIdToId(body[key]);
});
if (body.data && typeof body.data === "object") {
Object.keys(body.data).forEach(key => {
if (IdValues.includes(key))
body.data[key] = hashIdToId(body.data[key]);
});
}
}
await elasticSearch.index({
index: `${ELASTIC_LOGS_PREFIX}${year}-${month}-${day}`,
body,
Expand Down

0 comments on commit 14babbe

Please sign in to comment.