From 47c37a9fc7ed3c0340874b83f3b91001cceb881b Mon Sep 17 00:00:00 2001 From: "Dominik V. Salonen" Date: Thu, 24 Dec 2015 13:06:34 +0100 Subject: [PATCH] Added database exception, just in case and fixed a typo --- run.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/run.py b/run.py index ddbd85f..75b9dad 100755 --- a/run.py +++ b/run.py @@ -64,7 +64,7 @@ def allowed_file(filename): @app.route('/', methods=['GET', 'POST']) def upload_file(): if request.method == 'POST': - print_log('Web', 'New file Relieved') + print_log('Web', 'New file Received') if not auth(request.headers.get('X-Hyozan-Auth')): abort(403) data = dict() @@ -109,7 +109,10 @@ def terms(): @app.route('/', methods=['GET']) def get_file(filename): print_log('Web', 'Hit "' + filename + '" - ' + time_to_string(time.time())) - db.update_file(filename) + try: + db.update_file(filename) + except Exception: + print_log('Warning', 'Unable to update access time. Is the file in the database?') return send_from_directory(config['UPLOAD_FOLDER'], filename) @app.route('/share/')