Skip to content

Commit

Permalink
bug: logging loop error on startup resulted in overflow (#47)
Browse files Browse the repository at this point in the history
  • Loading branch information
SirTLB authored Feb 15, 2023
1 parent da20455 commit 3313a2d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 36 deletions.
2 changes: 1 addition & 1 deletion src/core/logging/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export { DiscordLogger } from "./discordLogger";
export { Logger } from "./logger";
export { SlackLogger } from "./slackLogger";
export { DiscordLogger } from "./discordLogger";

This file was deleted.

12 changes: 5 additions & 7 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,20 +69,18 @@ Connections Details:\n
const paths = getPaths(graph, botConfig.offerAssetInfo, botConfig.maxPathPools) ?? [];

const filteredPools = removedUnusedPools(allPools, paths);

setupMessage += `**Total Paths:** \t${paths.length}\n`;
for (let pathlength = 2; 2 <= botConfig.maxPathPools; pathlength++) {
setupMessage += `**\nDerived Paths for Arbitrage:
Total Paths:** \t${paths.length}\n`;
for (let pathlength = 2; pathlength <= botConfig.maxPathPools; pathlength++) {
const nrOfPaths = paths.filter((path) => path.pools.length === pathlength).length;
setupMessage += `
Derived Paths for Arbitrage:\n
**${pathlength} HOP Paths:** \t${nrOfPaths}`;
setupMessage += `**${pathlength} HOP Paths:** \t${nrOfPaths}\n`;
}

setupMessage += `(Removed ${allPools.length - filteredPools.length} unused pools)\n`;
setupMessage += "---".repeat(30);

startupMessage += setupMessage;

console.log(startupMessage);
await logger.sendMessage(startupMessage, LogType.Console);

let loop;
Expand Down

0 comments on commit 3313a2d

Please sign in to comment.