Commit d99e1c41 authored by Sebastien Robin's avatar Sebastien Robin

erp5_core: define what activity_watcher gadget should do when things are not working

If for some reasons, this gadget does not get results (usually due to network failures or
service unavailable for other reasons), do not fail and retry until it works again
parent 12e2ec98
/*global window, rJS, RSVP, Handlebars, jIO, location */
/*global window, rJS, RSVP, Handlebars, jIO, location, console */
/*jslint nomen: true, maxlen:80, indent:2*/
(function (rJS, jIO, Handlebars, RSVP, window) {
"use strict";
......@@ -61,6 +61,17 @@
})
.push(function () {
return getDataExamine();
})
.push(undefined, function (error) {
//Exception is raised if network is lost for some reasons,
//in this case, try patiently until network is back.
//There is probably more clean ways
console.log("error", error);
return new RSVP.Queue().push(function () {
return RSVP.delay(1000);
}).push(function () {
return getDataExamine();
});
});
}
return queue.push(function () {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment