refactor: Remove timeout settings from ipfs block storage.

This commit is contained in:
Hayden Young 2023-12-15 16:44:01 +00:00
parent 0a5f8b54e3
commit 5c187e7a47

View File

@ -7,15 +7,12 @@
import { CID } from 'multiformats/cid'
import { base58btc } from 'multiformats/bases/base58'
const defaultTimeout = 30000
/**
* Creates an instance of IPFSBlockStorage.
* @function
* @param {Object} params One or more parameters for configuring
* IPFSBlockStorage.
* @param {IPFS} params.ipfs An IPFS instance.
* @param {number} [params.timeout=defaultTimeout] A timeout in ms.
* @param {boolean} [params.pin=false] True, if the block should be pinned,
* false otherwise.
* @return {module:Storage.Storage-IPFS} An instance of IPFSBlockStorage.
@ -23,11 +20,9 @@ const defaultTimeout = 30000
* @throw An instance of ipfs is required if params.ipfs is not specified.
* @instance
*/
const IPFSBlockStorage = async ({ ipfs, timeout, pin } = {}) => {
const IPFSBlockStorage = async ({ ipfs, pin } = {}) => {
if (!ipfs) throw new Error('An instance of ipfs is required.')
timeout = timeout || defaultTimeout
/**
* Puts data to an IPFS block.
* @function