Prevent background thread from dying on an exception
Add mobile web support
This commit is contained in:
@@ -12,6 +12,7 @@
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div class="container">
|
<div class="container">
|
||||||
|
|||||||
8
web.py
8
web.py
@@ -32,6 +32,12 @@ def import_data():
|
|||||||
# import_data()
|
# import_data()
|
||||||
clf = Classifier(grab_all_data)
|
clf = Classifier(grab_all_data)
|
||||||
|
|
||||||
|
def tryUpdateHN():
|
||||||
|
try:
|
||||||
|
updateHN()
|
||||||
|
except Exception, e:
|
||||||
|
print e
|
||||||
|
|
||||||
@bottle.route("/update")
|
@bottle.route("/update")
|
||||||
def updateHN():
|
def updateHN():
|
||||||
print "Updating HN..."
|
print "Updating HN..."
|
||||||
@@ -120,7 +126,7 @@ def rate(id):
|
|||||||
bottle.redirect("/")
|
bottle.redirect("/")
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
schedule.every(10).minutes.do(updateHN)
|
schedule.every(10).minutes.do(tryUpdateHN)
|
||||||
st = SchedThread()
|
st = SchedThread()
|
||||||
#st.daemon = True
|
#st.daemon = True
|
||||||
st.start()
|
st.start()
|
||||||
|
|||||||
Reference in New Issue
Block a user