ipfspics-server icon indicating copy to clipboard operation
ipfspics-server copied to clipboard

Timeout for image loads

Open arvidj opened this issue 10 years ago • 3 comments

Sometimes (when using the random feature) the loading wont stop. I suppose the PHP application is waiting for IPFS. At least when the random feature is used, I think it would make sense to have a shorter timeout. There doesn't seem to be any timeout builtin the ipfs command line client, so the easiest way to implement this right now would probably be in the curl-request.

arvidj avatar Oct 28 '15 21:10 arvidj

I have added a five seconds limit in the new php ipfs wrapper. I'm not sure if that's too short or too long. There might be a delay if ipfs.pics needs to fetch images on another computer. I am thinking about redirecting to a page that will refresh a few seconds later in those cases.

What is your opinion on this?

cloutier avatar Oct 30 '15 00:10 cloutier

5 seconds sounds OK, I'm not sure how fast the network is in general. Sounds like a good idea to show a loading-message of some sort after 5 seconds, and then refresh a few times to see if IPFS has managed to load the image.

arvidj avatar Oct 31 '15 16:10 arvidj

Maybe we could use this to check if the object is available locally?

cloutier avatar Oct 31 '15 17:10 cloutier