mirror of
https://github.com/sasjs/adapter.git
synced 2026-01-06 04:00:05 +00:00
Merge branch 'master' into issue-186
This commit is contained in:
3771
package-lock.json
generated
3771
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
16
package.json
16
package.json
@@ -37,28 +37,28 @@
|
|||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/isomorphic-fetch": "0.0.35",
|
"@types/isomorphic-fetch": "0.0.35",
|
||||||
"@types/jest": "^26.0.15",
|
"@types/jest": "^26.0.20",
|
||||||
"cp": "^0.2.0",
|
"cp": "^0.2.0",
|
||||||
"dotenv": "^8.2.0",
|
"dotenv": "^8.2.0",
|
||||||
"jest": "^25.5.4",
|
"jest": "^25.5.4",
|
||||||
"path": "^0.12.7",
|
"path": "^0.12.7",
|
||||||
"rimraf": "^3.0.2",
|
"rimraf": "^3.0.2",
|
||||||
"semantic-release": "^17.3.0",
|
"semantic-release": "^17.3.1",
|
||||||
"terser-webpack-plugin": "^4.2.3",
|
"terser-webpack-plugin": "^4.2.3",
|
||||||
"ts-jest": "^25.5.1",
|
"ts-jest": "^25.5.1",
|
||||||
"ts-loader": "^8.0.11",
|
"ts-loader": "^8.0.14",
|
||||||
"tslint": "^6.1.3",
|
"tslint": "^6.1.3",
|
||||||
"tslint-config-prettier": "^1.18.0",
|
"tslint-config-prettier": "^1.18.0",
|
||||||
"typedoc": "^0.17.8",
|
"typedoc": "^0.19.2",
|
||||||
"typedoc-neo-theme": "^1.0.10",
|
"typedoc-neo-theme": "^1.0.10",
|
||||||
"typedoc-plugin-external-module-name": "^4.0.3",
|
"typedoc-plugin-external-module-name": "^4.0.6",
|
||||||
"typescript": "^3.9.7",
|
"typescript": "^3.9.7",
|
||||||
"webpack": "^4.44.2",
|
"webpack": "^5.13.0",
|
||||||
"webpack-cli": "^4.2.0"
|
"webpack-cli": "^4.3.1"
|
||||||
},
|
},
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@sasjs/utils": "^1.5.0",
|
"@sasjs/utils": "^2.0.2",
|
||||||
"es6-promise": "^4.2.8",
|
"es6-promise": "^4.2.8",
|
||||||
"form-data": "^3.0.0",
|
"form-data": "^3.0.0",
|
||||||
"isomorphic-fetch": "^2.2.1"
|
"isomorphic-fetch": "^2.2.1"
|
||||||
|
|||||||
@@ -1108,6 +1108,8 @@ export class SASViyaApiClient {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return new Promise(async (resolve, _) => {
|
return new Promise(async (resolve, _) => {
|
||||||
|
let printedState = ''
|
||||||
|
|
||||||
const interval = setInterval(async () => {
|
const interval = setInterval(async () => {
|
||||||
if (
|
if (
|
||||||
postedJobState === 'running' ||
|
postedJobState === 'running' ||
|
||||||
@@ -1115,9 +1117,6 @@ export class SASViyaApiClient {
|
|||||||
postedJobState === 'pending'
|
postedJobState === 'pending'
|
||||||
) {
|
) {
|
||||||
if (stateLink) {
|
if (stateLink) {
|
||||||
if (this.debug) {
|
|
||||||
console.log('Polling job status... \n')
|
|
||||||
}
|
|
||||||
const { result: jobState } = await this.request<string>(
|
const { result: jobState } = await this.request<string>(
|
||||||
`${this.serverUrl}${stateLink.href}?_action=wait&wait=30`,
|
`${this.serverUrl}${stateLink.href}?_action=wait&wait=30`,
|
||||||
{
|
{
|
||||||
@@ -1127,10 +1126,16 @@ export class SASViyaApiClient {
|
|||||||
)
|
)
|
||||||
|
|
||||||
postedJobState = jobState.trim()
|
postedJobState = jobState.trim()
|
||||||
if (this.debug) {
|
|
||||||
console.log(`Current state: ${postedJobState}\n`)
|
if (this.debug && printedState !== postedJobState) {
|
||||||
|
console.log('Polling job status...')
|
||||||
|
console.log(`Current job state: ${postedJobState}`)
|
||||||
|
|
||||||
|
printedState = postedJobState
|
||||||
}
|
}
|
||||||
|
|
||||||
pollCount++
|
pollCount++
|
||||||
|
|
||||||
if (pollCount >= MAX_POLL_COUNT) {
|
if (pollCount >= MAX_POLL_COUNT) {
|
||||||
resolve(postedJobState)
|
resolve(postedJobState)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,6 +23,10 @@ export class SessionManager {
|
|||||||
private currentContext: Context | null = null
|
private currentContext: Context | null = null
|
||||||
private csrfToken: CsrfToken | null = null
|
private csrfToken: CsrfToken | null = null
|
||||||
private _debug: boolean = false
|
private _debug: boolean = false
|
||||||
|
private printedSessionState = {
|
||||||
|
printed: false,
|
||||||
|
state: ''
|
||||||
|
}
|
||||||
|
|
||||||
public get debug() {
|
public get debug() {
|
||||||
return this._debug
|
return this._debug
|
||||||
@@ -175,8 +179,10 @@ export class SessionManager {
|
|||||||
sessionState === ''
|
sessionState === ''
|
||||||
) {
|
) {
|
||||||
if (stateLink) {
|
if (stateLink) {
|
||||||
if (this.debug) {
|
if (this.debug && !this.printedSessionState.printed) {
|
||||||
console.log('Polling session status... \n')
|
console.log('Polling session status...')
|
||||||
|
|
||||||
|
this.printedSessionState.printed = true
|
||||||
}
|
}
|
||||||
|
|
||||||
const { result: state } = await this.requestSessionStatus<string>(
|
const { result: state } = await this.requestSessionStatus<string>(
|
||||||
@@ -191,8 +197,11 @@ export class SessionManager {
|
|||||||
|
|
||||||
sessionState = state.trim()
|
sessionState = state.trim()
|
||||||
|
|
||||||
if (this.debug) {
|
if (this.debug && this.printedSessionState.state !== sessionState) {
|
||||||
console.log(`Current state is '${sessionState}'\n`)
|
console.log(`Current session state is '${sessionState}'`)
|
||||||
|
|
||||||
|
this.printedSessionState.state = sessionState
|
||||||
|
this.printedSessionState.printed = false
|
||||||
}
|
}
|
||||||
|
|
||||||
// There is an internal error present in SAS Viya 3.5
|
// There is an internal error present in SAS Viya 3.5
|
||||||
|
|||||||
Reference in New Issue
Block a user