mirror of
https://github.com/immich-app/immich
synced 2025-10-17 18:19:27 +00:00
fix: not clearing local data when logging out while sync is running (#20646)
This commit is contained in:
parent
094e3a2757
commit
4d0c9172e5
2 changed files with 6 additions and 3 deletions
|
|
@ -37,7 +37,7 @@ class BackgroundSyncManager {
|
|||
this.onHashingError,
|
||||
});
|
||||
|
||||
Future<void> cancel() {
|
||||
Future<void> cancel() async {
|
||||
final futures = <Future>[];
|
||||
|
||||
if (_syncTask != null) {
|
||||
|
|
@ -52,7 +52,11 @@ class BackgroundSyncManager {
|
|||
_syncWebsocketTask?.cancel();
|
||||
_syncWebsocketTask = null;
|
||||
|
||||
return Future.wait(futures);
|
||||
try {
|
||||
await Future.wait(futures);
|
||||
} on CanceledError {
|
||||
// Ignore cancellation errors
|
||||
}
|
||||
}
|
||||
|
||||
// No need to cancel the task, as it can also be run when the user logs out
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue