Created
May 2, 2024 16:49
-
-
Save djfarrelly/78b534572a6e13e3335556b96554afde to your computer and use it in GitHub Desktop.
Inngest: Disable cronjob in Branch Environment / Vercel preview
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const cronJob = inngest.createFunction( | |
{ id: 'cron-job' }, | |
process.env.VERCEL_ENV === 'preview' | |
? { event: 'trigger-cron' } | |
: { cron: '45 23 * * *' }, | |
async ({ step }) => { | |
// your logic here | |
} | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment