Skip to content
This repository has been archived by the owner on Nov 3, 2021. It is now read-only.

Bug 1224203 - Set Kinto.js http timeout to 180 seconds, r=ferjm #33523

Merged
merged 2 commits into from Dec 7, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 9 additions & 0 deletions apps/sharedtest/test/unit/sync/sync-engine/syncengine_test.js
Expand Up @@ -122,6 +122,15 @@ ld be a Function`);
var se = new SyncEngine(SynctoServerFixture.syncEngineOptions);
se.syncNow({ history: {} }).then(function() {
expect(se._kinto).to.be.instanceOf(Kinto);
expect(se._kinto.options).to.deep.equal({
bucket: SynctoServerFixture.xClientState,
remote: SynctoServerFixture.syncEngineOptions.URL,
timeout: 180 * 1000,
headers: {
'Authorization': 'BrowserID ' +
SynctoServerFixture.syncEngineOptions.assertion
}
});
done();
});
});
Expand Down
3 changes: 3 additions & 0 deletions shared/js/sync/engine.js
Expand Up @@ -61,6 +61,8 @@
*/

var SyncEngine = (function() {
const HTTP_TIMEOUT_SECONDS = 180;

var createFxSyncIdSchema = () => {
return {
generate: function() {
Expand Down Expand Up @@ -221,6 +223,7 @@ uld be a Function`);
var kinto = new Kinto({
bucket: kintoCredentials.xClientState,
remote: kintoCredentials.URL,
timeout: HTTP_TIMEOUT_SECONDS * 1000,
headers: {
'Authorization': 'BrowserID ' + kintoCredentials.assertion
}
Expand Down