mirror of
https://github.com/oceanprotocol/market.git
synced 2024-12-02 05:57:29 +01:00
fix repetitive requests
This commit is contained in:
parent
f2808b1dea
commit
afbc42068c
@ -83,6 +83,11 @@ export async function transformPublishFormToDdo(
|
|||||||
const currentTime = dateToStringNoMS(new Date())
|
const currentTime = dateToStringNoMS(new Date())
|
||||||
const isPreview = !datatokenAddress && !nftAddress
|
const isPreview = !datatokenAddress && !nftAddress
|
||||||
|
|
||||||
|
const algorithmContainerPresets =
|
||||||
|
type === 'algorithm' && dockerImage !== '' && dockerImage !== 'custom'
|
||||||
|
? await getAlgorithmContainerPreset(dockerImage)
|
||||||
|
: null
|
||||||
|
|
||||||
// Transform from files[0].url to string[] assuming only 1 file
|
// Transform from files[0].url to string[] assuming only 1 file
|
||||||
const filesTransformed = files?.length &&
|
const filesTransformed = files?.length &&
|
||||||
files[0].valid && [sanitizeUrl(files[0].url)]
|
files[0].valid && [sanitizeUrl(files[0].url)]
|
||||||
@ -113,19 +118,19 @@ export async function transformPublishFormToDdo(
|
|||||||
entrypoint:
|
entrypoint:
|
||||||
dockerImage === 'custom'
|
dockerImage === 'custom'
|
||||||
? dockerImageCustomEntrypoint
|
? dockerImageCustomEntrypoint
|
||||||
: (await getAlgorithmContainerPreset(dockerImage)).entrypoint,
|
: algorithmContainerPresets.entrypoint,
|
||||||
image:
|
image:
|
||||||
dockerImage === 'custom'
|
dockerImage === 'custom'
|
||||||
? dockerImageCustom
|
? dockerImageCustom
|
||||||
: (await getAlgorithmContainerPreset(dockerImage)).image,
|
: algorithmContainerPresets.image,
|
||||||
tag:
|
tag:
|
||||||
dockerImage === 'custom'
|
dockerImage === 'custom'
|
||||||
? dockerImageCustomTag
|
? dockerImageCustomTag
|
||||||
: (await getAlgorithmContainerPreset(dockerImage)).tag,
|
: algorithmContainerPresets.tag,
|
||||||
checksum:
|
checksum:
|
||||||
dockerImage === 'custom'
|
dockerImage === 'custom'
|
||||||
? dockerImageCustomChecksum
|
? dockerImageCustomChecksum
|
||||||
: (await getAlgorithmContainerPreset(dockerImage)).checksum
|
: algorithmContainerPresets.checksum
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user