mirror of
https://github.com/oceanprotocol/market.git
synced 2024-12-02 05:57:29 +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)
|
||||
|
||||
setHasPreviousDatasetOrder(true)
|
||||
await checkPreviousOrders(selectedAlgorithmAsset)
|
||||
await checkPreviousOrders(ddo)
|
||||
setIsPublished(true)
|
||||
} catch (error) {
|
||||
setError('Failed to start job!')
|
||||
|
@ -121,11 +121,10 @@ export async function getPreviousOrders(
|
||||
if (assetTimeout === '0') {
|
||||
return fetchedPreviousOrders?.data?.tokenOrders[0]?.tx
|
||||
} else {
|
||||
const expiry = new BigNumber(
|
||||
fetchedPreviousOrders?.data?.tokenOrders[0]?.timestamp
|
||||
).plus(assetTimeout)
|
||||
const unixTime = new BigNumber(Math.floor(Date.now() / 1000))
|
||||
if (unixTime.isLessThan(expiry)) {
|
||||
const expiry =
|
||||
fetchedPreviousOrders?.data?.tokenOrders[0]?.timestamp * 1000 +
|
||||
Number(assetTimeout) * 1000
|
||||
if (Date.now() <= expiry) {
|
||||
return fetchedPreviousOrders?.data?.tokenOrders[0]?.tx
|
||||
} else {
|
||||
return null
|
||||
|
Loading…
Reference in New Issue
Block a user