Skip to content
This repository has been archived by the owner on Jul 9, 2024. It is now read-only.

Commit

Permalink
Reduce verbosity
Browse files Browse the repository at this point in the history
  • Loading branch information
aquarat committed Oct 19, 2023
1 parent d5e6ccd commit 04da36a
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions src/alerting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,19 @@ const writeRecords = async () => {
const bufferedRecords = groupBy([...recordsToInsert], 'model');
recordsToInsert = [];

const results = await Promise.allSettled(
Object.entries(bufferedRecords).map(([model, data]) =>
// @ts-ignore
prismaActive[model].createMany({ data: data.map((item) => item.record) })
const results = (
await Promise.allSettled(
Object.entries(bufferedRecords).map(([model, data]) =>
// @ts-ignore
prismaActive[model].createMany({ data: data.map((item) => item.record) })
)
)
);
).filter((result) => result.status === 'rejected');

// eslint-disable-next-line no-console
console.error(results.filter((result) => result.status === 'rejected'));
if (results.length > 0) {
// eslint-disable-next-line no-console
console.error(results);
}

dbMutex = false;

Expand Down

0 comments on commit 04da36a

Please sign in to comment.