1
0
mirror of https://github.com/sasjs/adapter.git synced 2026-01-09 21:30:05 +00:00

feat(job-execution): populate folder map on demand

This commit is contained in:
Krishna Acondy
2020-09-17 09:35:43 +01:00
parent 5f5d84da87
commit d5a8140d4f
2 changed files with 164 additions and 225 deletions

View File

@@ -1079,21 +1079,18 @@ export default class SASjs {
private async getJobUri(sasJob: string) {
if (!this.sasViyaApiClient) return ''
const jobMap: any = await this.sasViyaApiClient.getAppLocMap()
let uri = ''
if (jobMap.size) {
const jobKey = sasJob.split('/')[0]
const jobName = sasJob.split('/')[1]
const jobKey = sasJob.split('/')[0]
const jobName = sasJob.split('/')[1]
const locJobs = jobMap.get(jobKey)
if (locJobs) {
const job = locJobs.find(
(el: any) => el.name === jobName && el.contentType === 'jobDefinition'
)
if (job) {
uri = job.uri
}
const locJobs = await this.sasViyaApiClient.getJobsInFolder(jobKey)
if (locJobs) {
const job = locJobs.find(
(el: any) => el.name === jobName && el.contentType === 'jobDefinition'
)
if (job) {
uri = job.uri
}
}
return uri