mirror of
https://github.com/oceanprotocol/market.git
synced 2024-12-02 05:57:29 +01:00
ignore old providers (#535)
Signed-off-by: mihaisc <mihai.scarlat@smartcontrol.ro>
This commit is contained in:
parent
749b5d1f8d
commit
1639a3e6ce
@ -181,42 +181,46 @@ export default function ComputeJobs(): ReactElement {
|
|||||||
Logger.error(err)
|
Logger.error(err)
|
||||||
}
|
}
|
||||||
for (let i = 0; i < providers.length; i++) {
|
for (let i = 0; i < providers.length; i++) {
|
||||||
const providerComputeJobs = (await providers[i].computeStatus(
|
try {
|
||||||
'',
|
const providerComputeJobs = (await providers[i].computeStatus(
|
||||||
account,
|
'',
|
||||||
undefined,
|
account,
|
||||||
undefined,
|
undefined,
|
||||||
false
|
undefined,
|
||||||
)) as ComputeJob[]
|
false
|
||||||
|
)) as ComputeJob[]
|
||||||
|
|
||||||
// means the provider uri is not good, so we ignore it and move on
|
// means the provider uri is not good, so we ignore it and move on
|
||||||
if (!providerComputeJobs) continue
|
if (!providerComputeJobs) continue
|
||||||
providerComputeJobs.sort((a, b) => {
|
providerComputeJobs.sort((a, b) => {
|
||||||
if (a.dateCreated > b.dateCreated) {
|
if (a.dateCreated > b.dateCreated) {
|
||||||
return -1
|
return -1
|
||||||
|
}
|
||||||
|
if (a.dateCreated < b.dateCreated) {
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
})
|
||||||
|
|
||||||
|
for (let j = 0; j < providerComputeJobs.length; j++) {
|
||||||
|
const job = providerComputeJobs[j]
|
||||||
|
const did = job.inputDID[0]
|
||||||
|
const ddo = assets.filter((x) => x.id === did)[0]
|
||||||
|
|
||||||
|
if (!ddo) continue
|
||||||
|
const serviceMetadata = ddo.service.filter(
|
||||||
|
(x: Service) => x.type === 'metadata'
|
||||||
|
)[0]
|
||||||
|
|
||||||
|
const compJob: ComputeJobMetaData = {
|
||||||
|
...job,
|
||||||
|
assetName: serviceMetadata.attributes.main.name,
|
||||||
|
assetDtSymbol: ddo.dataTokenInfo.symbol
|
||||||
|
}
|
||||||
|
computeJobs.push(compJob)
|
||||||
}
|
}
|
||||||
if (a.dateCreated < b.dateCreated) {
|
} catch (err) {
|
||||||
return 1
|
Logger.error(err)
|
||||||
}
|
|
||||||
return 0
|
|
||||||
})
|
|
||||||
|
|
||||||
for (let j = 0; j < providerComputeJobs.length; j++) {
|
|
||||||
const job = providerComputeJobs[j]
|
|
||||||
const did = job.inputDID[0]
|
|
||||||
const ddo = assets.filter((x) => x.id === did)[0]
|
|
||||||
|
|
||||||
if (!ddo) continue
|
|
||||||
const serviceMetadata = ddo.service.filter(
|
|
||||||
(x: Service) => x.type === 'metadata'
|
|
||||||
)[0]
|
|
||||||
|
|
||||||
const compJob: ComputeJobMetaData = {
|
|
||||||
...job,
|
|
||||||
assetName: serviceMetadata.attributes.main.name,
|
|
||||||
assetDtSymbol: ddo.dataTokenInfo.symbol
|
|
||||||
}
|
|
||||||
computeJobs.push(compJob)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
setJobs(computeJobs)
|
setJobs(computeJobs)
|
||||||
|
Loading…
Reference in New Issue
Block a user