Commit 9f25f1bc authored by Alain Takoudjou's avatar Alain Takoudjou Committed by Rafael Monnerat

[erp5_web_monitoring] set timeout value to prevent stalled sync on bad URL

parent 00caf2f9
......@@ -18,6 +18,7 @@
type: "replicatedopml",
remote_storage_unreachable_status: "WARNING",
remote_opml_check_time_interval: 86400000,
request_timeout: 25000, // timeout is to 25 second
local_sub_storage: {
type: "query",
sub_storage: {
......
......@@ -239,7 +239,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>962.48734.54444.887</string> </value>
<value> <string>964.14420.61705.7611</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -257,7 +257,7 @@
</tuple>
<state>
<tuple>
<float>1507899173.02</float>
<float>1513617981.41</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -18,6 +18,7 @@
* "type": "replicatedopml",
* "remote_storage_unreachable_status": "WARNING",
* "remote_opml_check_time_interval": 86400000,
* "request_timeout": 0,
* local_sub_storage: {
* type: "query",
* sub_storage: {
......@@ -73,6 +74,10 @@
// one day in miliseconds
this._remote_opml_check_time_interval = 86400000;
}
this._request_timeout = spec.request_timeout;
if (this._request_timeout === undefined) {
this._request_timeout = 0; // no timeout
}
}
ReplicatedOPMLStorage.prototype.get = function () {
......@@ -446,7 +451,8 @@
attachment_id: 'enclosure',
parser: 'rss',
sub_storage: {
type: "http"
type: "http",
timeout: context._request_timeout
}
},
id_hash,
......@@ -459,7 +465,8 @@
{
type: 'webhttp',
url: item.doc.url.replace('jio_private', 'private'),
basic_login: basic_login
basic_login: basic_login,
timeout: context._request_timeout
},
id_hash
));
......@@ -701,7 +708,8 @@
attachment_id: 'enclosure',
parser: 'opml',
sub_storage: {
type: "http"
type: "http",
timeout: context._request_timeout
}
},
storage_spec.basic_login
......
......@@ -239,7 +239,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>963.31914.46636.11724</string> </value>
<value> <string>964.6864.64042.34201</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -257,7 +257,7 @@
</tuple>
<state>
<tuple>
<float>1510928894.69</float>
<float>1513173747.08</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -27,6 +27,9 @@
}
options.xhrFields.withCredentials = storage._with_credentials;
}
if (storage._timeout !== undefined) {
options.timeout = storage._timeout;
}
return new RSVP.Queue()
.push(function () {
return jIO.util.ajax(options);
......@@ -81,6 +84,7 @@
this._authorization = "Basic " + spec.basic_login;
}
this._with_credentials = spec.with_credentials;
this._timeout = spec.timeout;
}
WEBHTTPStorage.prototype.get = function (id) {
......
......@@ -242,7 +242,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>961.21931.50854.43776</string> </value>
<value> <string>963.27666.8050.30907</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -260,7 +260,7 @@
</tuple>
<state>
<tuple>
<float>1502445069.19</float>
<float>1513173954.77</float>
<string>UTC</string>
</tuple>
</state>
......
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