Skip to content

Commit

Permalink
chore(index): set function checkBillet
Browse files Browse the repository at this point in the history
  • Loading branch information
wisley7l committed Aug 25, 2023
1 parent f1137f3 commit 2048023
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions functions/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ const { app, procedures } = require('./ecom.config')
// https://github.com/ecomplus/application-sdk
const { ecomServerIps, setup } = require('@ecomplus/application-sdk')

const checkBillet = require('./lib/banrisul/check-billet')

server.use(bodyParser.urlencoded({ extended: false }))
server.use(bodyParser.json())

Expand Down Expand Up @@ -143,3 +145,12 @@ exports.updateTokens = functions.pubsub.schedule(cron).onRun(() => {
})
})
console.log(`-- Sheduled update E-Com Plus tokens '${cron}'`)

// schedule check billets
const cronCheckBillets = '10 3 * * *'
exports.checkBillets = functions.pubsub.schedule(cronCheckBillets).onRun(() => {
return prepareAppSdk().then(appSdk => {
return checkBillet(admin, appSdk)
})
})
console.log(`-- Sheduled check billets Banrisul '${cronCheckBillets}'`)

0 comments on commit 2048023

Please sign in to comment.