Skip to content

Commit

Permalink
fix(bot): skip adding to CandlesChannel if bot is not timeframe-based
Browse files Browse the repository at this point in the history
  • Loading branch information
bludnic committed May 12, 2024
1 parent b9bd9b4 commit 6fb55ab
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/bot/src/processing/candles.processor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,10 @@ export class CandlesProcessor {
const symbol = `${bot.baseCurrency}/${bot.quoteCurrency}`;

if (bot.timeframe === null) {
logger.error(`CandlesProcessor: Bot ${bot.id} has no timeframe`);
throw new Error(`Bot ${bot.id} has no timeframe`);
logger.warn(
`CandlesProcessor: Bot ${bot.id} is not timeframe based. Skip adding to channel.`,
);
continue;
}

channel.add(symbol, bot.timeframe as BarSize);
Expand Down

0 comments on commit 6fb55ab

Please sign in to comment.