Skip to content

Commit

Permalink
new line
Browse files Browse the repository at this point in the history
  • Loading branch information
gotham13 committed Apr 8, 2024
1 parent b0c682b commit 2cd7557
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/utils/queue-batch-processor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@ import Logstash from "./logstash";

export default async (queue: Queue, logstash: Logstash) => {
const jobs = await queue.getJobs(undefined, 0, -1, true);
let jobData = [];
let jobData = "";
for (let job of jobs) {
jobData.push(job.data);
jobData = jobData + JSON.stringify(job.data) + "\r\n";
}
if (jobData.length > 0) {
logstash.log(jobData, async () => {
for (let job of jobs) {
await job.remove();
}
});
}
logstash.log(JSON.stringify(jobData), async () => {
for (let job of jobs) {
await job.remove();
}
});
};

0 comments on commit 2cd7557

Please sign in to comment.