Skip to content

Commit

Permalink
fix: delay precache for 10s
Browse files Browse the repository at this point in the history
Checking if CID is already in repo is expensive if the repo itself has a
lot of blocks. This may freeze the Welcome Screen on initial start.

Delaying background precache for 10s is a temporary fix until:
1. we finish async iterators migration
2. implement #878
  • Loading branch information
lidel committed May 15, 2020
1 parent c2c3f6b commit 4139a21
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion add-on/src/lib/ipfs-client/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ async function _reloadIpfsClientDependents (instance, opts) {
// online only
if (client && instance) {
// add important data to local ipfs repo for instant load
precache(instance)
setTimeout(() => precache(instance), 10000)
}
}

Expand Down

0 comments on commit 4139a21

Please sign in to comment.