Skip to content

Commit

Permalink
Merge pull request #34 from AgrI-Mitra/hotfix/lang-detection-failure
Browse files Browse the repository at this point in the history
updated retry logs
  • Loading branch information
Amruth-Vamshi authored Nov 22, 2024
2 parents 41de348 + f432d78 commit 3839a52
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 3839a52

Please sign in to comment.