Skip to content

Commit

Permalink
Update index.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
pradel committed Oct 21, 2024
1 parent e9d2514 commit ad4abb2
Showing 1 changed file with 8 additions and 16 deletions.
24 changes: 8 additions & 16 deletions apps/server/src/api/transactions/unique-senders/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@ export default defineCachedEventHandler(async (event) => {
transactionUniqueSendersRouteSchema,
);

const start = Date.now();
console.log("start", start);

const result = await sql`
WITH monthly_blocks AS (
SELECT
Expand Down Expand Up @@ -85,17 +82,12 @@ ORDER BY
mb.month ASC
`;

const end = Date.now();
console.log("end", end);
console.log("duration", end - start);

// const stats: TransactionUniqueSendersRouteResponse = result.map((row) => ({
// // format of the month is "2021-08-01 00:00:00+00"
// // we want to output "2021-08"
// month: row.month.slice(0, 7),
// unique_senders: Number.parseInt(row.unique_senders),
// }));
const stats: TransactionUniqueSendersRouteResponse = result.map((row) => ({
// format of the month is "2021-08-01 00:00:00+00"
// we want to output "2021-08"
month: row.month.slice(0, 7),
unique_senders: Number.parseInt(row.unique_senders),
}));

return result;
});
// }, apiCacheConfig);
return stats;
}, apiCacheConfig);

0 comments on commit ad4abb2

Please sign in to comment.