Skip to content

Commit

Permalink
fix: 5125 sendoutboundroot cron called twice (#5129)
Browse files Browse the repository at this point in the history
* fix: remove `process.exit()` sendoutboundroot

* fix: remove `process.exit` from LH
  • Loading branch information
liu-zhipeng authored Nov 6, 2023
1 parent 0a4fd27 commit d4ae7de
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@ export const makeProcessFromRoot = async (config: NxtpLighthouseConfig, chainDat
console.error("Error starting processor. Sad! :(", e);
} finally {
await closeDatabase();
process.exit();

context.logger.info("Process from root complete!!!", requestContext, methodContext, {
chains: [...Object.keys(context.config.chains)],
});
}
};
4 changes: 3 additions & 1 deletion packages/agents/lighthouse/src/tasks/propagate/propagate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ export const makePropagate = async (config: NxtpLighthouseConfig, chainData: Map
} catch (e: unknown) {
console.error("Error starting Propagate task. Sad! :(", e);
} finally {
process.exit();
context.logger.info("Propagate task complete!", requestContext, methodContext, {
chains: [...Object.keys(context.config.chains)],
});
}
};
4 changes: 3 additions & 1 deletion packages/agents/lighthouse/src/tasks/prover/prover.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { acquireLock, prefetch, releaseLock } from "./operations/publisher";
const context: ProverContext = {} as any;
export const getContext = () => context;
export const makeProverPublisher = async (config: NxtpLighthouseConfig, chainData: Map<string, ChainData>) => {
const { requestContext, methodContext } = createLoggingContext(makeProverPublisher.name);
try {
await makeProver(config, chainData);
if (!(await acquireLock())) throw new Error("Could not acquire lock");
Expand All @@ -30,7 +31,8 @@ export const makeProverPublisher = async (config: NxtpLighthouseConfig, chainDat
console.error("Error starting Prover-Publisher. Sad! :(", e);
} finally {
await closeDatabase();
process.exit();

context.logger.info("Prover complete!!!", requestContext, methodContext, {});
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ export const makeSendOutboundRoot = async (config: NxtpLighthouseConfig, chainDa
} catch (e: unknown) {
console.error("Error starting SendOutboundRoot task. Sad! :(", e);
} finally {
process.exit();
context.logger.info("SendOutboundRoot task complete!!!", requestContext, methodContext, {
chains: [...Object.keys(context.config.chains)],
});
}
};

0 comments on commit d4ae7de

Please sign in to comment.