1
0
mirror of https://github.com/sasjs/adapter.git synced 2025-12-11 09:24:35 +00:00

fix(logs): fetch log only when debug is switched on

This commit is contained in:
Krishna Acondy
2020-09-02 10:43:36 +01:00
parent 115caec761
commit c23e6352e2

View File

@@ -301,11 +301,12 @@ export class SASViyaApiClient {
{ headers }
)
let jobResult, log
let jobResult
let log
const logLink = currentJob.links.find((l) => l.rel === 'log')
if (true && logLink) {
if (debug && logLink) {
log = await this.request<any>(
`${this.serverUrl}${logLink.href}/content?limit=10000`,
{
@@ -317,7 +318,7 @@ export class SASViyaApiClient {
}
if (jobStatus === 'failed' || jobStatus === 'error') {
return Promise.reject({ error: currentJob.error, log: log })
return Promise.reject({ error: currentJob.error, log })
}
const resultLink = `/compute/sessions/${executionSessionId}/filerefs/_webout/content`