Prevent background thread from dying on an exception

Add mobile web support
This commit is contained in:
ultra
2017-03-13 16:08:45 -04:00
parent e60476af0a
commit dedeae2111
2 changed files with 8 additions and 1 deletions

View File

@@ -12,6 +12,7 @@
});
});
</script>
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<div class="container">

8
web.py
View File

@@ -32,6 +32,12 @@ def import_data():
# import_data()
clf = Classifier(grab_all_data)
def tryUpdateHN():
try:
updateHN()
except Exception, e:
print e
@bottle.route("/update")
def updateHN():
print "Updating HN..."
@@ -120,7 +126,7 @@ def rate(id):
bottle.redirect("/")
if __name__ == "__main__":
schedule.every(10).minutes.do(updateHN)
schedule.every(10).minutes.do(tryUpdateHN)
st = SchedThread()
#st.daemon = True
st.start()