Skip to content

Instantly share code, notes, and snippets.

@leah
Created October 24, 2019 04:26
Show Gist options
  • Save leah/d632a5af119aff37decea4e402eaa4aa to your computer and use it in GitHub Desktop.
Save leah/d632a5af119aff37decea4e402eaa4aa to your computer and use it in GitHub Desktop.
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