Skip to content

Commit

Permalink
for rebase, remove duplicate calc for agrows datetime. refs #6
Browse files Browse the repository at this point in the history
  • Loading branch information
rafamarts committed Dec 17, 2020
1 parent e7f81e3 commit 7bd9ef0
Showing 1 changed file with 0 additions and 19 deletions.
19 changes: 0 additions & 19 deletions services/star-ws/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,25 +71,6 @@ const publishMetrics = async (provider, node, data) => {
endPoint = route.reverse({ provider, node });

try {
const dateTimes = data.map(val => val.dateTime);
const uniq = dateTimes
.map(d => {
return {
count: 1,
d: d,
};
})
.reduce((a, b) => {
a[b.d] = (a[b.d] || 0) + b.count;
return a;
}, {});

const duplicates = Object.keys(uniq).filter(a => uniq[a] > 1);
if (duplicates.length > 0) {
const dup = data.filter(val => duplicates.includes(val.dateTime));
console.log(dup);
}
console.log(duplicates);
const response = await httpClient.post(endPoint, data);
logger.info(`POST Request for path /publish successfully executed!`);
return response;
Expand Down

0 comments on commit 7bd9ef0

Please sign in to comment.