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

chore(pid): made printing PID optional

This commit is contained in:
Yury Shkoda
2020-12-23 09:17:40 +03:00
parent 16e21adb20
commit 2e66bfde4b
2 changed files with 29 additions and 22 deletions

View File

@@ -441,7 +441,8 @@ export class SASViyaApiClient {
debug: boolean = false, debug: boolean = false,
expectWebout = false, expectWebout = false,
waitForResult = true, waitForResult = true,
pollOptions?: PollOptions pollOptions?: PollOptions,
printPid = false
): Promise<any> { ): Promise<any> {
try { try {
const headers: any = { const headers: any = {
@@ -461,6 +462,7 @@ export class SASViyaApiClient {
executionSessionId = session!.id executionSessionId = session!.id
if (printPid) {
const { result: jobIdVariable } = await this.sessionManager.getVariable( const { result: jobIdVariable } = await this.sessionManager.getVariable(
executionSessionId, executionSessionId,
'SYSJOBID', 'SYSJOBID',
@@ -480,6 +482,7 @@ export class SASViyaApiClient {
} at ${timestampToYYYYMMDDHHMMSS()}` } at ${timestampToYYYYMMDDHHMMSS()}`
) )
} }
}
const jobArguments: { [key: string]: any } = { const jobArguments: { [key: string]: any } = {
_contextName: contextName, _contextName: contextName,
@@ -988,7 +991,8 @@ export class SASViyaApiClient {
accessToken?: string, accessToken?: string,
waitForResult = true, waitForResult = true,
expectWebout = false, expectWebout = false,
pollOptions?: PollOptions pollOptions?: PollOptions,
printPid = false
) { ) {
if (isRelativePath(sasJob) && !this.rootFolderName) { if (isRelativePath(sasJob) && !this.rootFolderName) {
throw new Error( throw new Error(
@@ -1074,7 +1078,8 @@ export class SASViyaApiClient {
debug, debug,
expectWebout, expectWebout,
waitForResult, waitForResult,
pollOptions pollOptions,
printPid
) )
} }

View File

@@ -730,7 +730,8 @@ export default class SASjs {
config: any = {}, config: any = {},
accessToken?: string, accessToken?: string,
waitForResult?: boolean, waitForResult?: boolean,
pollOptions?: PollOptions pollOptions?: PollOptions,
printPid = false
) { ) {
config = { config = {
...this.sasjsConfig, ...this.sasjsConfig,
@@ -752,7 +753,8 @@ export default class SASjs {
accessToken, accessToken,
!!waitForResult, !!waitForResult,
false, false,
pollOptions pollOptions,
printPid
) )
} }