Risolve timeout creazione sessione YouTube lato app.
La setup broadcast YouTube (~23s) passa in background job; l'API risponde subito. Aumentato anche il timeout Dio mobile per createSession YouTube. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -167,6 +167,10 @@ class ApiClient {
|
||||
int? targetBitrate,
|
||||
int? targetFps,
|
||||
}) async {
|
||||
// YouTube: creazione broadcast + path MediaMTX può richiedere 20–30s lato server.
|
||||
final sessionTimeout = platform == 'youtube'
|
||||
? const Duration(seconds: 60)
|
||||
: const Duration(seconds: 30);
|
||||
final response = await _dio.post<Map<String, dynamic>>(
|
||||
'/matches/$matchId/sessions',
|
||||
data: {
|
||||
@@ -177,6 +181,10 @@ class ApiClient {
|
||||
if (targetBitrate != null) 'target_bitrate': targetBitrate,
|
||||
if (targetFps != null) 'target_fps': targetFps,
|
||||
},
|
||||
options: Options(
|
||||
sendTimeout: sessionTimeout,
|
||||
receiveTimeout: sessionTimeout,
|
||||
),
|
||||
);
|
||||
return StreamSession.fromJson(response.data!);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user