From 7ca673131feca0c9133724da31f33ff45cb09052 Mon Sep 17 00:00:00 2001 From: an-lee Date: Mon, 19 Feb 2024 11:01:16 +0800 Subject: [PATCH] do not auto upload recording --- enjoy/src/main/db/models/recording.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/enjoy/src/main/db/models/recording.ts b/enjoy/src/main/db/models/recording.ts index ef3455d69..7a71dd562 100644 --- a/enjoy/src/main/db/models/recording.ts +++ b/enjoy/src/main/db/models/recording.ts @@ -134,12 +134,10 @@ export class Recording extends Model { } async sync() { - this.upload().catch(() => {}); - const webApi = new Client({ baseUrl: process.env.WEB_API_URL || WEB_API_URL, accessToken: settings.getSync("user.accessToken") as string, - logger: log.scope("recording/sync"), + logger, }); return webApi.syncRecording(this.toJSON()).then(() => { @@ -156,11 +154,12 @@ export class Recording extends Model { return assessment; } + await this.upload(); await this.sync(); const webApi = new Client({ baseUrl: process.env.WEB_API_URL || WEB_API_URL, accessToken: settings.getSync("user.accessToken") as string, - logger: log.scope("recording/assess"), + logger, }); const { token, region } = await webApi.generateSpeechToken(); @@ -221,7 +220,7 @@ export class Recording extends Model { @AfterCreate static autoSync(recording: Recording) { - // auto upload should not block the main thread + // auto sync should not block the main thread recording.sync().catch(() => {}); }