mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-09-22 19:53:48 +08:00
chore(core): do remove timeout for audio transcription job (#12965)
#### PR Dependency Tree * **PR #12965** 👈 This tree was auto-generated by [Charcoal](https://github.com/danerwilliams/charcoal) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Improved request timeout handling to ensure timeouts are only set when appropriate and provide clearer error messages. * Updated audio transcription submission to wait indefinitely for completion, preventing requests from being aborted due to timeouts. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
@@ -41,9 +41,12 @@ export class FetchService extends Service {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const timeout = init?.timeout ?? 15000;
|
const timeout = init?.timeout ?? 15000;
|
||||||
const timeoutId = setTimeout(() => {
|
const timeoutId =
|
||||||
abortController.abort('timeout');
|
timeout > 0
|
||||||
}, timeout);
|
? setTimeout(() => {
|
||||||
|
abortController.abort(new Error('timeout after ' + timeout + 'ms'));
|
||||||
|
}, timeout)
|
||||||
|
: undefined;
|
||||||
|
|
||||||
let res: Response;
|
let res: Response;
|
||||||
|
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ export class AudioTranscriptionJobStore extends Entity<{
|
|||||||
}
|
}
|
||||||
const files = await this.props.getAudioFiles();
|
const files = await this.props.getAudioFiles();
|
||||||
const response = await graphqlService.gql({
|
const response = await graphqlService.gql({
|
||||||
timeout: 600_000, // default 15s is too short for audio transcription
|
timeout: 0, // default 15s is too short for audio transcription
|
||||||
query: submitAudioTranscriptionMutation,
|
query: submitAudioTranscriptionMutation,
|
||||||
variables: {
|
variables: {
|
||||||
workspaceId: this.currentWorkspaceId,
|
workspaceId: this.currentWorkspaceId,
|
||||||
|
|||||||
Reference in New Issue
Block a user