1
0
mirror of https://github.com/sasjs/adapter.git synced 2026-01-07 12:30:06 +00:00

feat(start-compute-job): add API that starts a compute job and immediately returns the session

This commit is contained in:
Krishna Acondy
2020-10-06 09:21:15 +01:00
parent 08f58b5f4f
commit fd6905ea9f
2 changed files with 59 additions and 7 deletions

View File

@@ -153,6 +153,7 @@ export class SASViyaApiClient {
context.name,
accessToken,
null,
true,
true
).catch(() => null)
})
@@ -425,7 +426,8 @@ export class SASViyaApiClient {
contextName: string,
accessToken?: string,
data = null,
expectWebout = false
expectWebout = false,
waitForResult = true
): Promise<any> {
try {
const headers: any = {
@@ -509,6 +511,10 @@ export class SASViyaApiClient {
postJobRequest
)
if (!waitForResult) {
return session
}
if (this.debug) {
console.log(`Job has been submitted for '${fileName}'.`)
console.log(
@@ -592,7 +598,9 @@ export class SASViyaApiClient {
linesOfCode,
contextName,
accessToken,
data
data,
false,
true
)
} else {
throw e
@@ -909,9 +917,9 @@ export class SASViyaApiClient {
public async executeComputeJob(
sasJob: string,
contextName: string,
debug: boolean,
data?: any,
accessToken?: string
accessToken?: string,
waitForResult = true
) {
if (isRelativePath(sasJob) && !this.rootFolderName) {
throw new Error(
@@ -992,7 +1000,8 @@ export class SASViyaApiClient {
contextName,
accessToken,
data,
true
true,
waitForResult
)
}