From 3e82f196c5e5af4eb1b16b07b5f5182316e0ebbd Mon Sep 17 00:00:00 2001 From: arvidn Date: Thu, 27 Jun 2024 10:20:09 +0200 Subject: [PATCH] fixup optimistic flush --- src/pread_disk_io.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pread_disk_io.cpp b/src/pread_disk_io.cpp index fbc20f77f0..3442c681bc 100644 --- a/src/pread_disk_io.cpp +++ b/src/pread_disk_io.cpp @@ -1472,8 +1472,9 @@ void pread_disk_io::thread_fun(aux::disk_io_thread_pool& pool auto* j = static_cast(pool.pop_front()); - if (&pool == &m_generic_threads) + if (&pool == &m_generic_threads || (j->flags & disk_interface::flush_piece)) { + DLOG("optimistic flush\n"); // This will attempt to flush any pieces that have been completely // downloaded try_flush_cache(int(m_cache.size()), l);