mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-25 10:22:55 +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 timeoutId = setTimeout(() => {
|
||||
abortController.abort('timeout');
|
||||
}, timeout);
|
||||
const timeoutId =
|
||||
timeout > 0
|
||||
? setTimeout(() => {
|
||||
abortController.abort(new Error('timeout after ' + timeout + 'ms'));
|
||||
}, timeout)
|
||||
: undefined;
|
||||
|
||||
let res: Response;
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ export class AudioTranscriptionJobStore extends Entity<{
|
||||
}
|
||||
const files = await this.props.getAudioFiles();
|
||||
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,
|
||||
variables: {
|
||||
workspaceId: this.currentWorkspaceId,
|
||||
|
||||
Reference in New Issue
Block a user