Commit a8703635 authored by Romain Courteaud's avatar Romain Courteaud

erp5_web_renderjs_ui: do not hammer zope during installation

parent 9b340758
......@@ -21,21 +21,27 @@
var required_file_dict = result_list[0],
cache = result_list[1],
key,
promise_list = [],
promise = Promise.resolve(),
url;
function append(url) {
promise = promise
.then(function () {
// Use cache.add because safari does not support cache.addAll.
return cache.add(url);
});
}
for (key in required_file_dict) {
if (required_file_dict.hasOwnProperty(key)) {
url = new URL(key, location.toString()).toString();
// Add all offline dependencies to the cache
// One by one, to not hammer zopes
required_url_list.push(url);
// Use cache.add because safari does not support cache.addAll.
// console.log("Install " + CACHE_NAME + " = " + url);
promise_list.push(cache.add(url));
append(url);
}
}
// Add all offline dependencies to the cache
return Promise.all(promise_list);
return promise;
})
.then(function () {
// When user accesses ERP5JS web site first time, service worker is
......
......@@ -238,7 +238,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>981.48930.15634.60876</string> </value>
<value> <string>981.49192.3036.63283</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -256,7 +256,7 @@
</tuple>
<state>
<tuple>
<float>1581325589.75</float>
<float>1581341953.03</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