Skip to content

Commit

Permalink
updated retry logs
Browse files Browse the repository at this point in the history
  • Loading branch information
Amruth-Vamshi committed Nov 22, 2024
1 parent fba877f commit f432d78
Showing 1 changed file with 23 additions and 8 deletions.
31 changes: 23 additions & 8 deletions src/modules/aiTools/ai-tools.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -327,11 +327,18 @@ export class AiToolsService {
redirect: 'follow',
retry: 4,
pause: 0,
callback: retry => {
console.log(`Re-Trying: ${retry}`);
},
timeout: 40000
url: this.configService.get("ULCA_CONFIG_URL"),
userId,
sessionId,
callback: null,
timeout: 30000
};

requestOptions.callback = function (retry) {
const elapsed = Date.now() - this.startTime;
console.log(`userId: ${this.userId} sessionId: ${this.sessionId} URL: ${this.url} (config API) Re-Trying: ${retry}, Previous failed call Time Taken: ${elapsed}ms`);
}.bind(requestOptions);

try{
this.monitoringService.incrementBhashiniCount()
let startDate = new Date();
Expand Down Expand Up @@ -390,12 +397,20 @@ export class AiToolsService {
redirect: 'follow',
retry: 4,
pause:0,
callback: retry => {
console.log(`Re-Trying: ${retry}`);
},
timeout: 40000
startTime: Date.now(),
url,
task,
userId,
sessionId,
callback: null,
timeout: 30000
};

requestOptions.callback = function (retry) {
const elapsed = Date.now() - this.startTime;
console.log(`userId: ${this.userId} sessionId: ${this.sessionId} URL: ${this.url} for task (${this.task}) Re-Trying: ${retry}, Previous failed call Time Taken: ${elapsed}ms`);
}.bind(requestOptions);

try{
this.monitoringService.incrementBhashiniCount()
let startDate = new Date();
Expand Down

0 comments on commit f432d78

Please sign in to comment.