Lecture 11: More Heroku & WSGI Features Flashcards
1
Q
What are clock dynos designed to do?
A
Schedule tasks at intervals, or at period times
2
Q
What files do we need to modify to set up a clock dyno?
A
- Procfile
clock: python scheduledjob.py - requirements.txt
apscheduler
tzlocal<3.0
3
Q
What does apscheduler do?
A
Allows us to call a function on a specified time interval using a blocking scheduling system
4
Q
What are the steps in creating a basic clock application?
A
- Import the apscheduler and create an
instance of a BlockingScheduler() - Set the time interval to run the scheduled
job, and define the job function - Start the scheduler when script beings
5
Q
What command do you run to start your clock dyno?
A
heroku ps:scale clock=1
6
Q
What command do you kill your clock dyno?
A
heroku ps:scale clock=0