File tree Expand file tree Collapse file tree 1 file changed +1
-6
lines changed
FirebaseAI/Sources/Types/Internal/Live Expand file tree Collapse file tree 1 file changed +1
-6
lines changed Original file line number Diff line number Diff line change @@ -114,7 +114,7 @@ actor LiveSessionService {
114
114
/// Seperated into its own function to make it easier to surface a way to call it seperately when
115
115
/// resuming the same session.
116
116
func connect( ) {
117
- setupTask . cancel ( )
117
+ close ( )
118
118
// we launch the setup task in a seperate task to avoid blocking the parent context
119
119
setupTask = Task { [ weak self] in
120
120
// we need a continuation to surface that the setup is complete, while still allowing us to listen to the server
@@ -148,11 +148,6 @@ actor LiveSessionService {
148
148
///
149
149
/// Will also close out the old websocket and the previous long running tasks.
150
150
private func listenToServer( _ setupComplete: CheckedContinuation < Void , any Error > ) async {
151
- // close out the existing connections, if any
152
- webSocket? . disconnect ( )
153
- responsesTask? . cancel ( )
154
- messageQueueTask? . cancel ( )
155
-
156
151
do {
157
152
webSocket = try await createWebsocket ( )
158
153
} catch {
You can’t perform that action at this time.
0 commit comments