You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 26, 2024. It is now read-only.
search(esQuery).then((resp)=>{// we're always trying to populate cache - when online
168
176
constres=_handleEsResult(resp,start,size)
169
-
cache.setItem(cacheKey,res).catch((err)=>{console.error('Cannot store cache for '+cacheKey+', '+err)})
170
-
if(!servedFromCache){// if navigator onLine == false means ES is unreachable and probably this will return false; sometimes returned false faster than indexedDb cache returns result ...
171
-
console.debug('Result from ES for '+cacheKey+' ('+entityType+'), ms='+(newDate().getTime()-benchmarkTime.getTime()))
172
-
res.cache=false
173
-
res.noresults=false
174
-
res.offline=false
175
-
resolve(res)
177
+
178
+
if(res){// otherwise it can be just a offline mode
179
+
cache.setItem(cacheKey,res).catch((err)=>{console.error('Cannot store cache for '+cacheKey+', '+err)})
180
+
if(!servedFromCache){// if navigator onLine == false means ES is unreachable and probably this will return false; sometimes returned false faster than indexedDb cache returns result ...
181
+
console.debug('Result from ES for '+cacheKey+' ('+entityType+'), ms='+(newDate().getTime()-benchmarkTime.getTime()))
0 commit comments