Update web.py

route /cache to admin clear cache without restart the server
pull/2788/head
Webysther Sperandio 1 year ago committed by GitHub
parent 3b4b0277e2
commit 193afd71b1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1632,3 +1632,10 @@ def show_book(book_id):
flash(_("Oops! Selected book is unavailable. File does not exist or is not accessible"),
category="error")
return redirect(url_for("web.index"))
@web.route('/cache', methods=['GET'])
def clear_cache():
if current_user.role_admin():
get_books.cache_clear()
return redirect(url_for('web.index'))

Loading…
Cancel
Save