Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev #276

Merged
merged 3 commits into from
Sep 14, 2023
Merged

Dev #276

Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading