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