Created
October 24, 2019 04:26
-
-
Save leah/d632a5af119aff37decea4e402eaa4aa to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pytz import utc | |
from apscheduler.schedulers.blocking import BlockingScheduler | |
from pickup.send import send_text, check_changes | |
print('Setting up scheduler...') | |
sched = BlockingScheduler(timezone=utc) | |
@sched.scheduled_job('interval', minutes=1) | |
def timed_job(): | |
# This should probably be done in the background but whatever | |
print('This clock job is run every minute.') | |
changed, message = check_changes() | |
if changed: | |
send_text(message=message) | |
sched.start() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment