Fix potential use-before-defined of serverList variable

This commit is contained in:
nOOb3167 2018-03-20 02:08:01 -04:00 committed by sfan5
parent 23d45c0a15
commit f43f201af5

View File

@ -139,9 +139,6 @@ def announce():
return "Thanks, your request has been filed.", 202 return "Thanks, your request has been filed.", 202
sched.add_job(lambda: serverList.purgeOld(), "interval",
seconds=60, coalesce=True, max_instances=1)
# Utilities # Utilities
# Returns ping time in seconds (up), False (down), or None (error). # Returns ping time in seconds (up), False (down), or None (error).
@ -401,6 +398,9 @@ class ServerList:
serverList = ServerList() serverList = ServerList()
sched.add_job(lambda: serverList.purgeOld(), "interval",
seconds=60, coalesce=True, max_instances=1)
if __name__ == "__main__": if __name__ == "__main__":
app.run(host = app.config["HOST"], port = app.config["PORT"]) app.run(host = app.config["HOST"], port = app.config["PORT"])