Skip to content

Commit

Permalink
Merge pull request #276 from Sunbird-cQube/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
htvenkatesh authored Sep 14, 2023
2 parents d79d186 + 47a8d7f commit 9eb80f8
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions src/ingestion/services/nvsk-api/nvsk-api.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ export class NvskApiService {
filteredCsvStream.write(Object.keys(row).join(',') + '\n');
isFirstRow = false;
}

if (row['state_code'].slice(1, -1) === process.env.STATE_ID) {
filteredCsvStream.write(Object.values(row).join(',') + '\n');
}
Expand Down Expand Up @@ -121,6 +122,7 @@ export class NvskApiService {
}
async scheduleAdapters(){
try {
let promises=[]
let url = `${process.env.SPEC_URL}` + '/schedule'
let processorGroups = ['Run_adapters','onestep_dataingestion_aws'];
for(let pgName of processorGroups){
Expand All @@ -129,14 +131,9 @@ export class NvskApiService {
"scheduled_at": "0 */7 * * * ?"
}
console.log("The schedule is:", scheduleBody);
let scheduleResult = await this.httpService.post(url, scheduleBody)
console.log('The schedule result is:',scheduleResult?.data['message']);
if (scheduleResult.status === 200) {
return { code: 200, message: scheduleResult?.['data']['message'] }
} else {
return { code: 400, error: "Adapter schedule failed" }
}
}
promises.push(this.httpService.post(url, scheduleBody))
}
await Promise.all(promises)
} catch (err) {
console.log("error for adapters is:", err);
}
Expand Down

0 comments on commit 9eb80f8

Please sign in to comment.