0

i am trying to execute multiple functions at different time everyday in my node js

 const cron1=cron.schedule(`30 5 * * *`,()=>{
    balanceCall(address,symbol,btc,options)
  })
  const cron2=cron.schedule(`30 2 * * *`,()=>{

    priceCall(address,symbol,btc)
  })

  cron1.start()
  cron2.start()

in both the function i am trying to get data and store it in mongo db. it is running all fine locally, but when i deploy it on render the code doesn't execute.

1 Answers1

0

I was missing timezone in the cron function. The edited function now looks as

const cron1=cron.schedule(`${process.env.cronBalanceTimings}`,()=>{
  balanceCall(contractAddress,symbol,BitSave,options)
},{timezone:'Asia/Calcutta'})