mirror of https://github.com/AMT-Cheif/drift.git
Avoid overly careful runZoneGuarded
This commit is contained in:
parent
9af708773c
commit
a8d57515c3
|
@ -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
|
||||
|
|
|
@ -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},
|
||||
);
|
||||
|
||||
|
|
Loading…
Reference in New Issue