We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f2d668f commit 02da810Copy full SHA for 02da810
packages/sqlite_async/lib/src/web/web_mutex.dart
@@ -114,10 +114,17 @@ class MutexImpl implements Mutex {
114
JSPromise jsCallback(JSAny lock) {
115
timer?.cancel();
116
117
+ final trace = StackTrace.current;
118
+ final heldSuspiciouslyLongTimer = Timer(const Duration(seconds: 10), () {
119
+ print('Warning: Database lock held for 10s: $trace');
120
+ });
121
+
122
// Give the Held lock something to mark this Navigator lock as completed
123
final jsCompleter = Completer.sync();
124
gotLock.complete(HeldLock._(jsCompleter));
- return jsCompleter.future.toJS;
125
+ return jsCompleter.future
126
+ .whenComplete(heldSuspiciouslyLongTimer.cancel)
127
+ .toJS;
128
}
129
130
final lockOptions = JSObject();
0 commit comments