Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Update to v3 of APScheduler
  • Loading branch information
sfan5 committed Dec 23, 2014
1 parent a3424b8 commit c9c97b0
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions server.py
Expand Up @@ -3,11 +3,11 @@
from threading import Thread, RLock
from operator import itemgetter

from apscheduler.scheduler import Scheduler
from apscheduler.schedulers.background import BackgroundScheduler
from flask import Flask, request, send_from_directory


sched = Scheduler()
sched = BackgroundScheduler()
sched.start()

app = Flask(__name__, static_url_path = "")
Expand Down Expand Up @@ -126,11 +126,10 @@ def announce():

return "Thanks, your request has been filed.", 202


@sched.interval_schedule(minutes=1, coalesce=True, max_instances=1)
def purgeOld():
serverList.purgeOld()

sched.add_job(purgeOld, "interval", seconds=60, coalesce=True, max_instances=1)

# Returns ping time in seconds (up), False (down), or None (error).
def serverUp(address, port):
Expand Down

0 comments on commit c9c97b0

Please sign in to comment.