I have a script written in Golang that does some http requests and store information in an external database. I want this script to be run once a day at a time that i set. Now i'm dealing with how to deploy it and my first option is Heroku since that's the platform i'm most familiar with. My problem is that i don't want the script to be run when i deploy it for the first time or every time i deploy an update.
Instead i was thinking about using scheduler add-on and set a time for the script to be executed. Is this possible or is there a more effective configuration for the script to be run only at a specified time?
Thank you in advance for your answers!
You should use gocron https://github.com/jasonlvhit/gocron
and run permanent your dino on heroku
in gocron you can shedule your services
gocron.Every(1).Second().Do(task)
gocron.Every(2).Seconds().Do(task)
gocron.Every(1).Minute().Do(task)
gocron.Every(2).Minutes().Do(task)
gocron.Every(1).Hour().Do(task)
gocron.Every(2).Hours().Do(task)
gocron.Every(1).Day().Do(task)
gocron.Every(2).Days().Do(task)