Skip to content

Commit

Permalink
Merge pull request #271 from dhanush-2397/dev
Browse files Browse the repository at this point in the history
changes for data-emitter API
  • Loading branch information
htvenkatesh authored Sep 14, 2023
2 parents 879e46a + f152c51 commit 6fdb46c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/ingestion/controller/ingestion.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ export class IngestionController {
}
}
@Post('/data-emitter')
@UseGuards(JwtGuard)
// @UseGuards(JwtGuard)
async fetchData(@Body()inputData:RawDataPullBody ,@Res()response: Response,@Req() request: Request){
try {
const result: any = await this.nvskService.getEmitterData(inputData?.program_names, request);
Expand Down
11 changes: 9 additions & 2 deletions src/ingestion/services/nvsk-api/nvsk-api.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,14 @@ export class NvskApiService {
"program_names": names
}
try {
let jwtToken;
const tokenResult = await this.httpService.get(process.env.URL + '/generatejwt')
if(tokenResult.status === 200){
jwtToken = tokenResult?.data
}
jwtToken = 'Bearer'+' '+jwtToken;
const headers = {
Authorization: request.headers.authorization
Authorization: jwtToken
};
const result = await this.httpService.post(process.env.NVSK_URL + '/getRawData', body,{headers: headers})
if (result?.data['code'] === 200) {
Expand Down Expand Up @@ -117,9 +123,10 @@ export class NvskApiService {
async scheduleAdapters(){
try {
let url = `${process.env.SPEC_URL}` + '/schedule'

let scheduleBody = {
"processor_group_name": "Run_adapters",
"scheduled_at": "* 0/7 * * * ?"
"scheduled_at": " 0 */5 * * * ?"
}
let scheduleResult = await this.httpService.post(url, scheduleBody)
console.log('The schedule result is:',scheduleResult?.data['message']);
Expand Down

0 comments on commit 6fdb46c

Please sign in to comment.