mirror of
https://github.com/mynodebtc/mynode.git
synced 2024-11-12 08:29:16 +00:00
Add status for failure to contact mynode
This commit is contained in:
parent
91bd5d02a7
commit
bff249ccfc
|
@ -196,6 +196,9 @@ def get_recent_upgrade_logs():
|
|||
pass
|
||||
return logs
|
||||
|
||||
def has_checkin_error():
|
||||
return os.path.isfile("/tmp/check_in_error")
|
||||
|
||||
#==================================
|
||||
# Reseller Info
|
||||
#==================================
|
||||
|
|
|
@ -84,6 +84,7 @@ def page_settings():
|
|||
"latest_version": latest_version,
|
||||
"current_beta_version": current_beta_version,
|
||||
"latest_beta_version": latest_beta_version,
|
||||
"has_checkin_error": has_checkin_error(),
|
||||
"upgrade_error": did_upgrade_fail(),
|
||||
"upgrade_logs": get_recent_upgrade_logs(),
|
||||
"serial_number": serial_number,
|
||||
|
@ -187,6 +188,7 @@ def page_status():
|
|||
"latest_version": latest_version,
|
||||
"current_beta_version": current_beta_version,
|
||||
"latest_beta_version": latest_beta_version,
|
||||
"has_checkin_error": has_checkin_error(),
|
||||
"upgrade_error": did_upgrade_fail(),
|
||||
"upgrade_logs": get_recent_upgrade_logs(),
|
||||
"serial_number": serial_number,
|
||||
|
|
|
@ -453,6 +453,12 @@
|
|||
<td>Local IP</td>
|
||||
<td style="padding-left: 20px;">{{local_ip}}</td>
|
||||
</tr>
|
||||
{% if has_checkin_error %}
|
||||
<tr>
|
||||
<td>Server</td>
|
||||
<td style="padding-left: 20px; color: red;"><b>Error contacting mynodebtc.com via Tor!</b><br/>You may have issues checking for new versions or saving product keys.</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
|
||||
</table>
|
||||
<div class="divider"></div>
|
||||
|
|
|
@ -183,6 +183,12 @@
|
|||
<td>Local IP</td>
|
||||
<td style="padding-left: 20px;">{{local_ip}}</td>
|
||||
</tr>
|
||||
{% if has_checkin_error %}
|
||||
<tr>
|
||||
<td>Server</td>
|
||||
<td style="padding-left: 20px; color: red;"><b>Error contacting mynodebtc.com via Tor!</b><br/>You may have issues checking for new versions or saving product keys.</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
|
||||
</table>
|
||||
<div class="divider"></div>
|
||||
|
|
|
@ -190,6 +190,7 @@ def check_in():
|
|||
os.system("echo '{}' > /home/bitcoin/.mynode/.product_key_error".format(r.text))
|
||||
os.system("printf \"%s | Check In Returned Error: {} \\n\" \"$(date)\" >> /tmp/check_in_status".format(r.text))
|
||||
|
||||
os.system("rm -f /tmp/check_in_error")
|
||||
check_in_success = True
|
||||
else:
|
||||
os.system("printf \"%s | Check In Failed. Retrying... Code {} \\n\" \"$(date)\" >> /tmp/check_in_status".format(r.status_code))
|
||||
|
@ -198,6 +199,7 @@ def check_in():
|
|||
|
||||
if not check_in_success:
|
||||
# Check in failed, try again in 2 minutes
|
||||
os.system("touch /tmp/check_in_error")
|
||||
time.sleep(120)
|
||||
|
||||
return True
|
Loading…
Reference in New Issue
Block a user