mirror of
https://github.com/oceanprotocol/react.git
synced 2025-02-01 20:39:28 +01:00
allow timeout pass through
This commit is contained in:
parent
65d43f80a3
commit
678d9a0b80
@ -15,6 +15,7 @@ interface UsePublish {
|
|||||||
asset: Metadata,
|
asset: Metadata,
|
||||||
serviceConfigs: ServiceType,
|
serviceConfigs: ServiceType,
|
||||||
dataTokenOptions: DataTokenOptions,
|
dataTokenOptions: DataTokenOptions,
|
||||||
|
timeout?: number,
|
||||||
providerUri?: string
|
providerUri?: string
|
||||||
) => Promise<DDO | undefined | null>
|
) => Promise<DDO | undefined | null>
|
||||||
mint: (tokenAddress: string, tokensToMint: string) => void
|
mint: (tokenAddress: string, tokensToMint: string) => void
|
||||||
@ -53,10 +54,10 @@ function usePublish(): UsePublish {
|
|||||||
asset: Metadata,
|
asset: Metadata,
|
||||||
serviceType: ServiceType,
|
serviceType: ServiceType,
|
||||||
dataTokenOptions: DataTokenOptions,
|
dataTokenOptions: DataTokenOptions,
|
||||||
|
timeout?: number,
|
||||||
providerUri?: string
|
providerUri?: string
|
||||||
): Promise<DDO | undefined | null> {
|
): Promise<DDO | undefined | null> {
|
||||||
if (status !== ProviderStatus.CONNECTED || !ocean || !account) return null
|
if (status !== ProviderStatus.CONNECTED || !ocean || !account) return null
|
||||||
|
|
||||||
setIsLoading(true)
|
setIsLoading(true)
|
||||||
setPublishError(undefined)
|
setPublishError(undefined)
|
||||||
|
|
||||||
@ -71,6 +72,7 @@ function usePublish(): UsePublish {
|
|||||||
const price = '1'
|
const price = '1'
|
||||||
switch (serviceType) {
|
switch (serviceType) {
|
||||||
case 'access': {
|
case 'access': {
|
||||||
|
if (!timeout) timeout = 0
|
||||||
const accessService = await ocean.assets.createAccessServiceAttributes(
|
const accessService = await ocean.assets.createAccessServiceAttributes(
|
||||||
account,
|
account,
|
||||||
price,
|
price,
|
||||||
@ -83,7 +85,7 @@ function usePublish(): UsePublish {
|
|||||||
break
|
break
|
||||||
}
|
}
|
||||||
case 'compute': {
|
case 'compute': {
|
||||||
timeout = 3600
|
if (!timeout) timeout = 3600
|
||||||
const cluster = ocean.compute.createClusterAttributes(
|
const cluster = ocean.compute.createClusterAttributes(
|
||||||
'Kubernetes',
|
'Kubernetes',
|
||||||
'http://10.0.0.17/xxx'
|
'http://10.0.0.17/xxx'
|
||||||
|
Loading…
Reference in New Issue
Block a user