refactor(timeout): reuse shared api request timeout

This commit is contained in:
2026-04-21 13:13:13 +00:00
parent 44eb9b9173
commit da7375c889
4 changed files with 27 additions and 7 deletions
+2 -1
View File
@@ -11,6 +11,7 @@ import type {
TContainerType,
} from '../interfaces/container.ts';
import type { IChatCompletionRequest, IChatCompletionResponse } from '../interfaces/api.ts';
import { API_SERVER } from '../constants.ts';
import { ContainerRuntime } from '../docker/container-runtime.ts';
import { logger } from '../logger.ts';
@@ -165,7 +166,7 @@ export abstract class BaseContainer {
const url = `${endpoint}${path}`;
const controller = new AbortController();
const timeout = options.timeout || 30000;
const timeout = options.timeout || API_SERVER.REQUEST_TIMEOUT_MS;
const timeoutId = setTimeout(() => controller.abort(), timeout);
try {