mirror of
https://github.com/sasjs/adapter.git
synced 2026-06-08 18:20:20 +00:00
fix(debug): send _debug=128 via URL for runAsTask debug, drop _omittextlog
This commit is contained in:
@@ -55,13 +55,7 @@ export abstract class BaseJobExecutor implements JobExecutor {
|
||||
if (config.debug) {
|
||||
requestParams['_omittextlog'] = 'false'
|
||||
requestParams['_omitSessionResults'] = 'false'
|
||||
|
||||
requestParams['_debug'] =
|
||||
config.useComputeApi === null &&
|
||||
config.serverType === ServerType.SasViya &&
|
||||
config.runAsTask === true
|
||||
? 128
|
||||
: 131
|
||||
requestParams['_debug'] = 131
|
||||
}
|
||||
|
||||
return requestParams
|
||||
|
||||
@@ -123,6 +123,22 @@ export class WebJobExecutor extends BaseJobExecutor {
|
||||
// _executionTasks=true. Dummy file keeps the body non-empty
|
||||
const hasExecutionTasksFlag = config.runAsTask === true
|
||||
|
||||
// Move debug params to URL for viya; viya seems to honor them more
|
||||
// reliably in the query string than the multipart body.
|
||||
if (
|
||||
hasExecutionTasksFlag &&
|
||||
config.debug &&
|
||||
config.serverType === ServerType.SasViya
|
||||
) {
|
||||
const debugKeys = ['_debug', '_omitSessionResults']
|
||||
debugKeys.forEach((key) => {
|
||||
if (requestParams[key] !== undefined) {
|
||||
apiUrl += `&${key}=${encodeURIComponent(requestParams[key])}`
|
||||
delete requestParams[key]
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
if (data) {
|
||||
const stringifiedData = JSON.stringify(data)
|
||||
if (
|
||||
@@ -255,6 +271,23 @@ export class WebJobExecutor extends BaseJobExecutor {
|
||||
return requestPromise
|
||||
}
|
||||
|
||||
protected getRequestParams(config: any): any {
|
||||
const requestParams = super.getRequestParams(config)
|
||||
|
||||
// FIXME(viya - possible issue with default debug flags)
|
||||
// runAsTask on Viya: use _debug=128 (not 131) and omit _omittextlog
|
||||
if (
|
||||
config.debug &&
|
||||
config.serverType === ServerType.SasViya &&
|
||||
config.runAsTask === true
|
||||
) {
|
||||
requestParams['_debug'] = 128
|
||||
delete requestParams['_omittextlog']
|
||||
}
|
||||
|
||||
return requestParams
|
||||
}
|
||||
|
||||
private async getJobUri(sasJob: string) {
|
||||
if (!this.sasViyaApiClient) return ''
|
||||
let uri = ''
|
||||
|
||||
Reference in New Issue
Block a user