mirror of
https://github.com/oceanprotocol/market.git
synced 2024-11-15 01:34:57 +01:00
Merge pull request #588 from oceanprotocol/fix/issue583-start-second-job
Fix/Start a second compute job after first successful attempt
This commit is contained in:
commit
0954613b5e
@ -359,7 +359,8 @@ export default function Compute({
|
|||||||
|
|
||||||
Logger.log('[compute] Starting compute job response: ', response)
|
Logger.log('[compute] Starting compute job response: ', response)
|
||||||
|
|
||||||
setHasPreviousDatasetOrder(true)
|
await checkPreviousOrders(selectedAlgorithmAsset)
|
||||||
|
await checkPreviousOrders(ddo)
|
||||||
setIsPublished(true)
|
setIsPublished(true)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
setError('Failed to start job!')
|
setError('Failed to start job!')
|
||||||
|
@ -121,11 +121,10 @@ export async function getPreviousOrders(
|
|||||||
if (assetTimeout === '0') {
|
if (assetTimeout === '0') {
|
||||||
return fetchedPreviousOrders?.data?.tokenOrders[0]?.tx
|
return fetchedPreviousOrders?.data?.tokenOrders[0]?.tx
|
||||||
} else {
|
} else {
|
||||||
const expiry = new BigNumber(
|
const expiry =
|
||||||
fetchedPreviousOrders?.data?.tokenOrders[0]?.timestamp
|
fetchedPreviousOrders?.data?.tokenOrders[0]?.timestamp * 1000 +
|
||||||
).plus(assetTimeout)
|
Number(assetTimeout) * 1000
|
||||||
const unixTime = new BigNumber(Math.floor(Date.now() / 1000))
|
if (Date.now() <= expiry) {
|
||||||
if (unixTime.isLessThan(expiry)) {
|
|
||||||
return fetchedPreviousOrders?.data?.tokenOrders[0]?.tx
|
return fetchedPreviousOrders?.data?.tokenOrders[0]?.tx
|
||||||
} else {
|
} else {
|
||||||
return null
|
return null
|
||||||
|
Loading…
Reference in New Issue
Block a user