add ability to clear the cache

This commit is contained in:
Izalia Mae 2022-09-02 05:11:00 -04:00
parent de5dd44d9a
commit fc42cba8f8
2 changed files with 14 additions and 0 deletions

View file

@ -101,6 +101,13 @@
=config_number('Port for the api server to listen on', 'bw_port', config.bw_port, 1024, 65535)
=config_checkbox('Use an external api server', 'bw_external', config.bw_external)
%details.category.section open
%summary << Maintenance
.container.grid-container
%span << Cache
%span
%a.button onclick='request("/action/clear-cache");' << Clear
%details.category.section open
%summary << Advanced
.container.grid-container

View file

@ -75,6 +75,13 @@ def about(handler, request):
return request.page('about')
### Actions ###
@Local.route('/action/clear-cache')
def action_clear_cache(handler, request):
handler.app.context.clear_cache()
return request.ok_or_redirect('Cleared cache')
### Bookmarks ###
@Local.route('/bookmarks')
def bookmarks_home(handler, request):