Cron jobs

schedule code execution

the onSchedule function expects:

  • a time-interval string, that may start with every, such as every day 00:00
  • a callback function

v2

export const computeAndStoreRankingsCRON = onSchedule("every day 00:00", async () => {
    // ...
})

v1

export const computeAndStoreRankingsCRON = functions.pubsub
    .schedule("every 8 hours")
    .onRun(async function (context) {
        // ..
    })
earlymorning logo

© 2025 - All rights reserved

Cron jobs

schedule code execution

the onSchedule function expects:

  • a time-interval string, that may start with every, such as every day 00:00
  • a callback function

v2

export const computeAndStoreRankingsCRON = onSchedule("every day 00:00", async () => {
    // ...
})

v1

export const computeAndStoreRankingsCRON = functions.pubsub
    .schedule("every 8 hours")
    .onRun(async function (context) {
        // ..
    })