Skip to content

Commit 0f6f222

Browse files
authored
Add maxJobDuration into paid compute task. (#921)
1 parent d526062 commit 0f6f222

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

src/components/core/compute/utils.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,10 @@ export async function validateAlgoForDataset(
8787
if (algoDID) {
8888
if (
8989
// if not set allow them all
90-
!compute.publisherTrustedAlgorithms &&
91-
!compute.publisherTrustedAlgorithmPublishers
90+
(!Array.isArray(compute.publisherTrustedAlgorithms) ||
91+
compute.publisherTrustedAlgorithms.length === 0) &&
92+
(!Array.isArray(compute.publisherTrustedAlgorithmPublishers) ||
93+
compute.publisherTrustedAlgorithmPublishers.length === 0)
9294
) {
9395
return true
9496
}

src/components/httpRoutes/compute.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ computeRoutes.post(`${SERVICES_API_BASE_PATH}/compute`, async (req, res) => {
7272
signature: (req.body.signature as string) || null,
7373
nonce: (req.body.nonce as string) || null,
7474
environment: (req.body.environment as string) || null,
75+
maxJobDuration: (req.body.maxJobDuration as number) || null,
7576
algorithm: (req.body.algorithm as ComputeAlgorithm) || null,
7677
datasets: (req.body.datasets as unknown as ComputeAsset[]) || null,
7778
payment: (req.body.payment as unknown as ComputePayment) || null,

0 commit comments

Comments
 (0)