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

feat(pollJobState): made pollOptions optional and updated docs

This commit is contained in:
Yury Shkoda
2020-11-30 12:27:09 +03:00
parent 1b117a67aa
commit 6d166efd11
2 changed files with 6 additions and 6 deletions

View File

@@ -957,7 +957,7 @@ export class SASViyaApiClient {
* @param accessToken - an optional access token for an authorized user.
* @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 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(
sasJob: string,
@@ -1252,12 +1252,12 @@ export class SASViyaApiClient {
accessToken?: string,
pollOptions?: PollOptions
) {
let MAX_POLL_COUNT = 1000
let POLL_INTERVAL = 100
let MAX_POLL_COUNT = 1000
if (pollOptions) {
MAX_POLL_COUNT = pollOptions.MAX_POLL_COUNT
POLL_INTERVAL = pollOptions.POLL_INTERVAL
POLL_INTERVAL = pollOptions.POLL_INTERVAL || POLL_INTERVAL
MAX_POLL_COUNT = pollOptions.MAX_POLL_COUNT || MAX_POLL_COUNT
}
let postedJobState = ''

View File

@@ -1,4 +1,4 @@
export interface PollOptions {
MAX_POLL_COUNT: number
POLL_INTERVAL: number
MAX_POLL_COUNT?: number
POLL_INTERVAL?: number
}