Skip to content

Commit

Permalink
Avoid overly careful runZoneGuarded
Browse files Browse the repository at this point in the history
  • Loading branch information
simolus3 committed Jun 7, 2022
1 parent 9af7087 commit a8d5751
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
1 change: 1 addition & 0 deletions docs/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ dev_dependencies:
drift_dev:

dependency_overrides:
# Waiting for dartdoc, https://github.com/dart-lang/dartdoc/pull/3033
analyzer: ^4.0.0
moor:
path: ../moor
Expand Down
5 changes: 2 additions & 3 deletions drift/lib/src/runtime/cancellation_zone.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,8 @@ CancellationToken<T> runCancellable<T>(
Future<T> Function() operation,
) {
final token = CancellationToken<T>();
runZonedGuarded(
() => operation().then(token._resultCompleter.complete),
token._resultCompleter.completeError,
runZoned(
() => token._resultCompleter.complete(Future.sync(operation)),
zoneValues: {_key: token},
);

Expand Down

0 comments on commit a8d5751

Please sign in to comment.