refactor(timeout): reuse shared api request timeout
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user