Resetting Electrum Server data no longer needs reboot

This commit is contained in:
Taylor Helsper 2021-10-23 09:25:58 -05:00
parent aafc981965
commit 05c7ec8599
3 changed files with 6 additions and 13 deletions

View File

@ -870,12 +870,13 @@ def restart_electrs():
t.start()
def delete_electrs_data():
os.system("rm -rf /mnt/hdd/mynode/electrs")
os.system("rm -rf /mnt/hdd/mynode/electrs/bitcoin")
os.system("rm -rf /mnt/hdd/mynode/electrs/testnet")
def reset_electrs():
stop_electrs()
delete_electrs_data()
reboot_device()
restart_electrs()
#==================================

View File

@ -530,19 +530,11 @@ def open_clone_tool_page():
def reset_electrs_page():
check_logged_in()
check_and_mark_reboot_action("reset_electrs")
t = Timer(1.0, reset_electrs)
t.start()
# Display wait page
templateData = {
"title": "myNode",
"header_text": "Resetting Electrum Data",
"subheader_text": "This will take several minutes...",
"ui_settings": read_ui_settings()
}
return render_template('reboot.html', **templateData)
flash("Resetting Electrum Server data...", category="message")
return redirect("/settings")
@mynode_settings.route("/settings/clear-mempool-cache")
def clear_mempool_cache_page():

View File

@ -835,7 +835,7 @@
<div class="settings_block_header">Electrum Server</div>
<div class="settings_block_subheader">Reset Electrum Server</div>
Advanced: This will delete your Electrum Server data and reboot your device.
This will delete your Electrum Server data and restart Electrum Server.
<br/>
<a href="/settings/reset-electrs" class="ui-button ui-widget ui-corner-all settings_button">Reset Data</a>