diff options
| author | JP Dillingham <jp@dillingham.me> | 2022-08-19 17:43:32 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-08-19 17:43:32 -0500 |
| commit | 11759b4e5a59f8ed59464331ea5451e5a7a922d4 (patch) | |
| tree | 84a4d8b663164868b05cd65bb5bb154750b64ccd /src/slskd/Application.cs | |
| parent | b75728d54f37dde6d53a9a412b68e827604a3c6a (diff) | |
| parent | b9d0fdfd50eb185c967d70b15e89134d406be875 (diff) | |
| download | slskd-11759b4e5a59f8ed59464331ea5451e5a7a922d4.tar.gz | |
Merge pull request #605 from slskd/sqlite-sync
Remove SQLite asynchrony
Diffstat (limited to 'src/slskd/Application.cs')
| -rw-r--r-- | src/slskd/Application.cs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/slskd/Application.cs b/src/slskd/Application.cs index 6f1c2c86..f9cb95d2 100644 --- a/src/slskd/Application.cs +++ b/src/slskd/Application.cs @@ -263,7 +263,7 @@ namespace slskd // records to be updated if the application has started to shut down so that we can do this cleanup and properly // disposition them as having failed due to an application shutdown, instead of some random exception thrown while // things are being disposed. - var activeUploads = (await Transfers.Uploads.ListAsync(t => !t.State.HasFlag(TransferStates.Completed) && !t.Removed)) + var activeUploads = Transfers.Uploads.List(t => !t.State.HasFlag(TransferStates.Completed) && !t.Removed) .Where(t => !t.State.HasFlag(TransferStates.Completed)) // https://github.com/dotnet/efcore/issues/10434 .ToList(); @@ -272,10 +272,10 @@ namespace slskd Log.Debug("Cleaning up dangling upload {Filename} to {Username}", upload.Filename, upload.Username); upload.State = TransferStates.Completed | TransferStates.Errored; upload.Exception = ApplicationShutdownTransferExceptionMessage; - Transfers.Uploads.UpdateSync(upload); + Transfers.Uploads.Update(upload); } - var activeDownloads = (await Transfers.Downloads.ListAsync(t => !t.State.HasFlag(TransferStates.Completed) && !t.Removed)) + var activeDownloads = Transfers.Downloads.List(t => !t.State.HasFlag(TransferStates.Completed) && !t.Removed) .Where(t => !t.State.HasFlag(TransferStates.Completed)) // https://github.com/dotnet/efcore/issues/10434 .ToList(); @@ -284,7 +284,7 @@ namespace slskd Log.Debug("Cleaning up dangling download {Filename} from {Username}", download.Filename, download.Username); download.State = TransferStates.Completed | TransferStates.Errored; download.Exception = ApplicationShutdownTransferExceptionMessage; - Transfers.Downloads.UpdateSync(download); + Transfers.Downloads.Update(download); } // save the ids of any downloads that were active, so we can re-enqueue them after we've connected and logged in. @@ -526,7 +526,7 @@ namespace slskd // we previously saved a list of all of the download ids that were active at the previous shutdown; fetch the latest // record for those transfers from the db and ensure they haven't been removed from the UI while the application was offline // the user doesn't want those transfers anymore and we don't want to add them back. - var resumeableDownloads = await Transfers.Downloads.ListAsync(t => !t.Removed && ActiveDownloadIdsAtPreviousShutdown.Contains(t.Id)); + var resumeableDownloads = Transfers.Downloads.List(t => !t.Removed && ActiveDownloadIdsAtPreviousShutdown.Contains(t.Id)); if (resumeableDownloads.Any()) { |
