Save session data once on shutdown, before waiting for stopped announces

Write it after downloads stop, or after the loop if skipped; one error policy for saves.
This commit is contained in:
Ivan
2026-10-16 11:48:46 +03:00
committed by Jari Sundell
parent 9dd54038b4
commit 5a3b4e50cd
5 changed files with 79 additions and 32 deletions
+5 -1
View File
@@ -489,7 +489,11 @@ main(int argc, char** argv) {
torrent::system::Thread::self()->event_loop();
control->core()->download_list()->session_save();
// A quick shutdown with no tracker request pending leaves the loop before
// handle_shutdown() could save.
if (!control->is_shutdown_session_saved())
control->core()->download_list()->session_save();
control->cleanup();
} catch (torrent::internal_error& e) {