mirror of
https://github.com/sasjs/adapter.git
synced 2026-01-17 09:00:06 +00:00
feat(pollJobState): made pollOptions optional and updated docs
This commit is contained in:
@@ -957,7 +957,7 @@ export class SASViyaApiClient {
|
|||||||
* @param accessToken - an optional access token for an authorized user.
|
* @param accessToken - an optional access token for an authorized user.
|
||||||
* @param waitForResult - a boolean indicating if the function should wait for a result.
|
* @param waitForResult - a boolean indicating if the function should wait for a result.
|
||||||
* @param expectWebout - a boolean indicating whether to expect a _webout response.
|
* @param expectWebout - a boolean indicating whether to expect a _webout response.
|
||||||
* @param pollOptions - an object that represents poll interval and maximum amount of attempts.
|
* @param pollOptions - an object that represents poll interval(milliseconds) and maximum amount of attempts. Object example: { MAX_POLL_COUNT: 24 * 60 * 60, POLL_INTERVAL: 1000 }.
|
||||||
*/
|
*/
|
||||||
public async executeComputeJob(
|
public async executeComputeJob(
|
||||||
sasJob: string,
|
sasJob: string,
|
||||||
@@ -1252,12 +1252,12 @@ export class SASViyaApiClient {
|
|||||||
accessToken?: string,
|
accessToken?: string,
|
||||||
pollOptions?: PollOptions
|
pollOptions?: PollOptions
|
||||||
) {
|
) {
|
||||||
let MAX_POLL_COUNT = 1000
|
|
||||||
let POLL_INTERVAL = 100
|
let POLL_INTERVAL = 100
|
||||||
|
let MAX_POLL_COUNT = 1000
|
||||||
|
|
||||||
if (pollOptions) {
|
if (pollOptions) {
|
||||||
MAX_POLL_COUNT = pollOptions.MAX_POLL_COUNT
|
POLL_INTERVAL = pollOptions.POLL_INTERVAL || POLL_INTERVAL
|
||||||
POLL_INTERVAL = pollOptions.POLL_INTERVAL
|
MAX_POLL_COUNT = pollOptions.MAX_POLL_COUNT || MAX_POLL_COUNT
|
||||||
}
|
}
|
||||||
|
|
||||||
let postedJobState = ''
|
let postedJobState = ''
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
export interface PollOptions {
|
export interface PollOptions {
|
||||||
MAX_POLL_COUNT: number
|
MAX_POLL_COUNT?: number
|
||||||
POLL_INTERVAL: number
|
POLL_INTERVAL?: number
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user