Skip to content

Commit 6a3af80

Browse files
authored
Merge pull request #1489 from rocket-admin/backend_redis_fixes
Backend redis fixes
2 parents 8412e85 + 965bcd0 commit 6a3af80

File tree

3 files changed

+2011
-1647
lines changed

3 files changed

+2011
-1647
lines changed

backend/src/entities/ai/amazon-bedrock/amazon-bedrock.ai.provider.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
import { Injectable } from '@nestjs/common';
21
import { BedrockRuntimeClient, ConverseCommand } from '@aws-sdk/client-bedrock-runtime';
2+
import { Injectable } from '@nestjs/common';
33
import { IAIProvider } from './ai-provider.interface.js';
44

55
@Injectable()
66
export class AmazonBedrockAiProvider implements IAIProvider {
77
private readonly bedrockRuntimeClient: BedrockRuntimeClient;
88
private readonly modelId: string = 'global.anthropic.claude-sonnet-4-5-20250929-v1:0';
9-
private readonly maxTokens: number = 1024;
109

1110
constructor() {
1211
this.bedrockRuntimeClient = new BedrockRuntimeClient();
@@ -22,7 +21,6 @@ export class AmazonBedrockAiProvider implements IAIProvider {
2221
const command = new ConverseCommand({
2322
modelId: this.modelId,
2423
messages: conversation,
25-
inferenceConfig: { maxTokens: this.maxTokens },
2624
});
2725
try {
2826
const response = await this.bedrockRuntimeClient.send(command);

backend/src/interceptors/timeout.interceptor.ts

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,21 @@ import { Messages } from '../exceptions/text/messages.js';
55

66
@Injectable()
77
export class TimeoutInterceptor implements NestInterceptor {
8-
intercept(_context: ExecutionContext, next: CallHandler): Observable<any> {
9-
const timeoutMs = process.env.NODE_ENV !== 'test' ? 15000 : 200000;
10-
return next.handle().pipe(
11-
timeout(timeoutMs),
12-
catchError((err) => {
13-
if (err instanceof TimeoutError) {
14-
return throwError(
15-
() =>
16-
new RequestTimeoutException({
17-
message: Messages.CONNECTION_TIMED_OUT,
18-
}),
19-
);
20-
}
21-
return throwError(() => err);
22-
}),
23-
);
24-
}
8+
intercept(_context: ExecutionContext, next: CallHandler): Observable<any> {
9+
const timeoutMs = process.env.NODE_ENV !== 'test' ? 15000 : 200000;
10+
return next.handle().pipe(
11+
timeout(timeoutMs),
12+
catchError((err) => {
13+
if (err instanceof TimeoutError) {
14+
return throwError(
15+
() =>
16+
new RequestTimeoutException({
17+
message: Messages.CONNECTION_TIMED_OUT,
18+
}),
19+
);
20+
}
21+
return throwError(() => err);
22+
}),
23+
);
24+
}
2525
}

0 commit comments

Comments
 (0)