From 4139a211f7a6e38b70b978d343e3ddaded8c3486 Mon Sep 17 00:00:00 2001 From: Marcin Rataj Date: Fri, 15 May 2020 03:22:18 +0200 Subject: [PATCH] fix: delay precache for 10s 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 https://github.com/ipfs-shipyard/ipfs-companion/issues/878 --- add-on/src/lib/ipfs-client/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/add-on/src/lib/ipfs-client/index.js b/add-on/src/lib/ipfs-client/index.js index e481820be..c122aff17 100644 --- a/add-on/src/lib/ipfs-client/index.js +++ b/add-on/src/lib/ipfs-client/index.js @@ -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) } }