Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandrumatei36 committed Oct 7, 2024
1 parent 7a84ff2 commit 2661bb6
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions packages/indexer/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@ export async function Main(config: parseEnv.Config, logger: winston.Logger) {
);

let exitRequested = false;

process.on("SIGINT", () => {
if (!exitRequested) {
logger.info(
Expand All @@ -144,20 +143,21 @@ export async function Main(config: parseEnv.Config, logger: winston.Logger) {
at: "Indexer#Main",
});
// start all indexers in parallel, will wait for them to complete, but they all loop independently
const [hubPoolResult] = await Promise.allSettled([
hubPoolIndexer.start(),
bundleProcessor.start(10),
...spokePoolIndexers.map((s) => s.start()),
]);
const [bundleResults, hubPoolResult, ...spokeResults] =
await Promise.allSettled([
bundleProcessor.start(10),
hubPoolIndexer.start(),
...spokePoolIndexers.map((s) => s.start()),
]);

logger.info({
at: "Indexer#Main",
message: "Indexer loop completed",
results: {
// spokeIndexerRunSuccess: [...spokeResults].every(
// (r) => r.status === "fulfilled",
// ),
// bundleProcessorRunSuccess: bundleResults.status === "fulfilled",
spokeIndexerRunSuccess: [...spokeResults].every(
(r) => r.status === "fulfilled",
),
bundleProcessorRunSuccess: bundleResults.status === "fulfilled",
hubPoolIndexerRunSuccess: hubPoolResult.status === "fulfilled",
},
});
Expand Down

0 comments on commit 2661bb6

Please sign in to comment.