File tree Expand file tree Collapse file tree 2 files changed +12
-3
lines changed
Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ import * as Sentry from "@sentry/node";
1111import SignatureRequestProcessorCron from "./cron/SignatureRequestProcessing.js" ;
1212import OrderInvalidationCronjob from "./cron/OrderInvalidation.js" ;
1313import { container } from "tsyringe" ;
14+ import { ENABLE_CRON_JOBS } from "./utils/constants.js" ;
1415
1516// @ts -expect-error BigInt is not supported by JSON
1617BigInt . prototype . toJSON = function ( ) {
@@ -47,9 +48,14 @@ RegisterRoutes(app);
4748Sentry . setupExpressErrorHandler ( app ) ;
4849
4950// Start Safe signature request processing cron job
50- SignatureRequestProcessorCron . start ( ) ;
51- const cronJob = container . resolve ( OrderInvalidationCronjob ) ;
52- cronJob . start ( ) ;
51+ if ( ENABLE_CRON_JOBS ) {
52+ console . log ( "🚀 Starting cron jobs" ) ;
53+ SignatureRequestProcessorCron . start ( ) ;
54+ const cronJob = container . resolve ( OrderInvalidationCronjob ) ;
55+ cronJob . start ( ) ;
56+ } else {
57+ console . log ( "🚨 Cron jobs are disabled" ) ;
58+ }
5359
5460app . listen ( PORT , ( ) => {
5561 console . log (
Original file line number Diff line number Diff line change @@ -20,3 +20,6 @@ export const drpcApiPkey = getRequiredEnvVar("DRPC_API_KEY");
2020export const cachingDatabaseUrl = getRequiredEnvVar ( "CACHING_DATABASE_URL" ) ;
2121export const dataDatabaseUrl = getRequiredEnvVar ( "DATA_DATABASE_URL" ) ;
2222export const filecoinApiKey = getRequiredEnvVar ( "FILECOIN_API_KEY" ) ;
23+
24+ const ENABLE_CRON_JOBS_ENV = getRequiredEnvVar ( "ENABLE_CRON_JOBS" ) ;
25+ export const ENABLE_CRON_JOBS = ENABLE_CRON_JOBS_ENV === "true" ;
You can’t perform that action at this time.
0 commit comments