Skip to content

Commit

Permalink
fix: regression in queue init (chrisleekr#581)
Browse files Browse the repository at this point in the history
  • Loading branch information
uhliksk authored Jan 12, 2023
1 parent 98b756e commit 4be42b9
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions app/cronjob/trailingTradeHelper/queue.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
const _ = require('lodash');
const { executeTrailingTrade } = require('../index');

let startedJobs = {};
let finishedJobs = {};
const startedJobs = {};
const finishedJobs = {};

/**
* Initialize queue counters for symbols
Expand All @@ -13,13 +13,12 @@ let finishedJobs = {};
const init = async (funcLogger, symbols) => {
const logger = funcLogger.child({ helper: 'queue' });

startedJobs = {};
finishedJobs = {};

await Promise.all(
_.map(symbols, async symbol => {
startedJobs[symbol] = 0;
finishedJobs[symbol] = 0;
if (startedJobs[symbol] === undefined) {
startedJobs[symbol] = 0;
finishedJobs[symbol] = 0;
}
})
);

Expand Down

0 comments on commit 4be42b9

Please sign in to comment.