Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 17 additions & 3 deletions app/lib/task/backend.dart
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,21 @@ class TaskBackend {
while (!aborted.isCompleted) {
// Acquire the global lock and scan for package changes while lock is
// valid.
await lock.withClaim((claim) async {
await _scanForPackageUpdates(claim, abort: aborted);
}, abort: aborted);
try {
await lock.withClaim((claim) async {
await _scanForPackageUpdates(claim, abort: aborted);
}, abort: aborted);
} catch (e, st) {
// Log this as very bad, and then move on. Nothing good can come
// from straight up stopping.
_log.shout(
'scanning failed (will retry when lock becomes free)',
e,
st,
);
// Sleep 5 minutes to reduce risk of degenerate behavior
await Future.delayed(Duration(minutes: 5));
}
}
} catch (e, st) {
_log.severe('scanning loop crashed', e, st);
Expand Down Expand Up @@ -159,6 +171,8 @@ class TaskBackend {
e,
st,
);
// Sleep 5 minutes to reduce risk of degenerate behavior
await Future.delayed(Duration(minutes: 5));
}
}
} catch (e, st) {
Expand Down