Skip to content

Commit f43f201

Browse files
nOOb3167sfan5
authored andcommittedMay 18, 2018
Fix potential use-before-defined of serverList variable
1 parent 23d45c0 commit f43f201

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed
 

Diff for: ‎server.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -139,9 +139,6 @@ def announce():
139139

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

142-
sched.add_job(lambda: serverList.purgeOld(), "interval",
143-
seconds=60, coalesce=True, max_instances=1)
144-
145142
# Utilities
146143

147144
# Returns ping time in seconds (up), False (down), or None (error).
@@ -401,6 +398,9 @@ def update(self, server):
401398

402399
serverList = ServerList()
403400

401+
sched.add_job(lambda: serverList.purgeOld(), "interval",
402+
seconds=60, coalesce=True, max_instances=1)
403+
404404
if __name__ == "__main__":
405405
app.run(host = app.config["HOST"], port = app.config["PORT"])
406406

0 commit comments

Comments
 (0)