Skip to content

Instantly share code, notes, and snippets.

@djfarrelly
Created May 2, 2024 16:49
Show Gist options
  • Save djfarrelly/78b534572a6e13e3335556b96554afde to your computer and use it in GitHub Desktop.
Save djfarrelly/78b534572a6e13e3335556b96554afde to your computer and use it in GitHub Desktop.
Inngest: Disable cronjob in Branch Environment / Vercel preview
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