Skip to content

Commit

Permalink
Merge branch 'main' into issue-54-agreementid-stop
Browse files Browse the repository at this point in the history
  • Loading branch information
paulo-ocean committed Jul 2, 2024
2 parents 0de53e8 + ed8de0d commit 644c01a
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -576,13 +576,23 @@ export class Commands {
}

public async getJobStatus(args: string[]) {
// args[1] - did (for checking if data asset exists, legacy)
// args[2] - jobId
// args[3] - agreementId
const hasAgreementId = args.length === 4;

const dataDdo = await this.aquarius.waitForAqua(args[1]);
if (!dataDdo) {
console.error(
"Error fetching DDO " + args[1] + ". Does this asset exists?"
);
return;
}
const jobId = args[2]
let agreementId = null;
if(hasAgreementId) {
agreementId = args[3];
}
const providerURI =
this.macOsProviderUrl && dataDdo.chainId === 8996
? this.macOsProviderUrl
Expand All @@ -591,8 +601,8 @@ export class Commands {
const jobStatus = (await ProviderInstance.computeStatus(
providerURI,
await this.signer.getAddress(),
args[2],
args[1]
jobId,
agreementId
)) as ComputeJob;
console.log(util.inspect(jobStatus, false, null, true));
}
Expand Down

0 comments on commit 644c01a

Please sign in to comment.