Skip to content

Commit

Permalink
Fix incorrect timeout log on evaluate requests (#442)
Browse files Browse the repository at this point in the history
  • Loading branch information
Fryuni authored Dec 5, 2024
1 parent 83fad07 commit 8db161a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/evaluator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ export class Evaluator {
let timer: number | NodeJS.Timeout | undefined;

if (timeout !== undefined) {
setTimeout(
timer = setTimeout(
() => {
const response: ErrorResponse = {
title: `Evaluation could not be completed in time for query "${reference}".`,
Expand Down
2 changes: 2 additions & 0 deletions test/evaluator.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,8 @@ describe('An evaluator', () => {

await expect(evaluator.evaluate(query, {timeout: 10})).resolves.toBe('Carol');

jest.advanceTimersByTime(11);

expect(logger.error).not.toHaveBeenCalled();
});

Expand Down

0 comments on commit 8db161a

Please sign in to comment.