Skip to content

Commit

Permalink
[gui] don't attempt mounts if launch failed
Browse files Browse the repository at this point in the history
  • Loading branch information
andrei-toterman committed Jan 24, 2025
1 parent 4506a35 commit b6fdf74
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/client/gui/lib/grpc_client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -76,18 +76,21 @@ class GrpcClient {
Future<void>? cancel,
}) async* {
logger.i('Sent ${request.repr}');
final launchStream = _client.launch(Stream.value(request));
cancel?.then((_) => launchStream.cancel());
yield* launchStream
final launchReplyStream = _client.launch(Stream.value(request));
cancel?.then((_) => launchReplyStream.cancel());
final launchStream = launchReplyStream
.doOnData(checkForUpdate)
.doOnEach(logGrpc(request))
.map(Either.left);
.map(Either<LaunchReply, MountReply>.left);
await for (final launchReply in launchStream) {
yield launchReply;
}
for (final mountRequest in mountRequests) {
logger.i('Sent ${mountRequest.repr}');
yield* _client
.mount(Stream.value(mountRequest))
.doOnEach(logGrpc(mountRequest))
.map(Either.right);
.map((Either<LaunchReply, MountReply>.right));
}
}

Expand Down

0 comments on commit b6fdf74

Please sign in to comment.