Skip to content

Commit

Permalink
chore: create cron schedule to send orders
Browse files Browse the repository at this point in the history
  • Loading branch information
matheusgnreis authored Jul 15, 2024
1 parent 24e1800 commit 889b558
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions functions/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,12 @@ server.use(router)
exports[functionName] = functions.https.onRequest(server)
console.log(`-- Starting '${app.title}' E-Com Plus app with Function '${functionName}'`)

const cronSendOrders = '*/59 * * * *'
const sendWaitingOrders = require('./lib/ux-group/send-waiting-orders')
exports.sendWaitingOrders = functions.runWith({ timeoutSeconds: 300 })
.pubsub.schedule(cronSendOrders).onRun(sendWaitingOrders)
console.log(`-- Sheduled send tags to UX API ${cronSendOrders}`)

// schedule update tokens job
const cron = '25 */3 * * *'
exports.updateTokens = functions.pubsub.schedule(cron).onRun(() => {
Expand Down

0 comments on commit 889b558

Please sign in to comment.