Skip to content

Commit

Permalink
fixup! Process concurrent events sequentially when saving logs to file
Browse files Browse the repository at this point in the history
  • Loading branch information
dab246 committed Jun 19, 2024
1 parent 0b6452b commit b0aa980
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions core/lib/utils/log_tracking.dart
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,17 @@ class LogTracking {
}

Future _executeTraceLog() async {
while (true) {
if (_messagesQueue.isEmpty) {
_isScheduled = false;
return;
try {
while (true) {
if (_messagesQueue.isEmpty) {
_isScheduled = false;
return;
}

final message = _messagesQueue.removeFirst();
await saveLog(message: message);
}

final message = _messagesQueue.removeFirst();
await saveLog(message: message);
}
} catch (_) {}
}

Future<void> saveLog({required String message}) async {
Expand Down

0 comments on commit b0aa980

Please sign in to comment.