[FIX] hw_screen: Add delay to longpolling

When an error occurred in the longpolling, we used to resend a new
request immediately. This resulted in thousands of request in a few
seconds when we lost connection to the box.

closes odoo/odoo#32544

Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
This commit is contained in:
Antoine Prieels
2019-04-09 09:27:35 +00:00
parent 6bae16b788
commit 5e8b667951
+6 -3
View File
@@ -47,14 +47,17 @@
foreign_js();
}
}
},
complete: function(jqXHR,err) {
if (!stop_longpolling) {
longpolling();
}
},
error: function (jqXHR, status, err) {
if (!stop_longpolling) {
setTimeout(longpolling, 5000);
}
},
timeout: 30000,
});
};