aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMaximilien Cuony <maximilien@theglu.org>2016-09-12 19:36:23 +0200
committerMaximilien Cuony <maximilien@theglu.org>2016-09-12 19:36:23 +0200
commit1b02875f393e15609e6422311541cb361b0bd428 (patch)
tree70d6c96113bae1b890ac268c4c0d2826182dbd71
parent18fb541004d3666cf722e3eeae8ed9aeab9503d2 (diff)
downloadglutte-serial-web-1b02875f393e15609e6422311541cb361b0bd428.tar.gz
glutte-serial-web-1b02875f393e15609e6422311541cb361b0bd428.tar.bz2
glutte-serial-web-1b02875f393e15609e6422311541cb361b0bd428.zip
Remove debug for ADSL and try to log more errors for ws
-rw-r--r--adsl.py3
-rw-r--r--templates/index.html4
2 files changed, 4 insertions, 3 deletions
diff --git a/adsl.py b/adsl.py
index 119ad35..8cf73fe 100644
--- a/adsl.py
+++ b/adsl.py
@@ -123,7 +123,7 @@ class Monitor(threading.Thread):
if self.last_balise and (datetime.datetime.now() - self.last_balise).total_seconds() > 10800:
result.append("No FSM_BALISE_LONGUE nor FSM_BALISE_SPECIALE for more than 3 hours !")
- if self.current_state and self.current_state in MAXIMUM_STATES and (datetime.datetime.now() - self.status_starttime[self.current_state]).total_seconds() > MAXIMUM_STATES[self.current_state][0] / 10:
+ if self.current_state and self.current_state in MAXIMUM_STATES and (datetime.datetime.now() - self.status_starttime[self.current_state]).total_seconds() > MAXIMUM_STATES[self.current_state][0]:
result.append("The FSM has been in the state {} for more than {} !".format(self.current_state, MAXIMUM_STATES[self.current_state][1]))
return result
@@ -160,6 +160,7 @@ class ADSL(threading.Thread):
offset = updates[0].update_id + 1
try:
+ print(updates[0].message.chat.id)
if int(updates[0].message.chat.id) == int(config.TELEGRAM_GROUP):
if updates[0].message.text.startswith('/status'):
diff --git a/templates/index.html b/templates/index.html
index 9687b25..815623a 100644
--- a/templates/index.html
+++ b/templates/index.html
@@ -51,11 +51,11 @@
}
}
- socket.onerror = function() {
+ socket.onerror = function(e) {
closed = true;
if (!retry_scheduled) {
- add_message("{System} Websocket error. Trying again in 3s :(\n");
+ add_message("{System} Websocket error. Trying again in 3s :( " + e + "\n");
setTimeout(init_socket, 3000);
retry_scheduled = true;
}