[thin/cache_repair (rust)] Fix file open options
This commit is contained in:
parent
63b8b9fc40
commit
052c9f90ea
4
src/cache/repair.rs
vendored
4
src/cache/repair.rs
vendored
@ -32,11 +32,11 @@ fn new_context(opts: &CacheRepairOptions) -> Result<Context> {
|
|||||||
let engine_out: Arc<dyn IoEngine + Send + Sync>;
|
let engine_out: Arc<dyn IoEngine + Send + Sync>;
|
||||||
|
|
||||||
if opts.async_io {
|
if opts.async_io {
|
||||||
engine_in = Arc::new(AsyncIoEngine::new(opts.input, MAX_CONCURRENT_IO, true)?);
|
engine_in = Arc::new(AsyncIoEngine::new(opts.input, MAX_CONCURRENT_IO, false)?);
|
||||||
engine_out = Arc::new(AsyncIoEngine::new(opts.output, MAX_CONCURRENT_IO, true)?);
|
engine_out = Arc::new(AsyncIoEngine::new(opts.output, MAX_CONCURRENT_IO, true)?);
|
||||||
} else {
|
} else {
|
||||||
let nr_threads = std::cmp::max(8, num_cpus::get() * 2);
|
let nr_threads = std::cmp::max(8, num_cpus::get() * 2);
|
||||||
engine_in = Arc::new(SyncIoEngine::new(opts.input, nr_threads, true)?);
|
engine_in = Arc::new(SyncIoEngine::new(opts.input, nr_threads, false)?);
|
||||||
engine_out = Arc::new(SyncIoEngine::new(opts.output, nr_threads, true)?);
|
engine_out = Arc::new(SyncIoEngine::new(opts.output, nr_threads, true)?);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -33,11 +33,11 @@ fn new_context(opts: &ThinRepairOptions) -> Result<Context> {
|
|||||||
let engine_out: Arc<dyn IoEngine + Send + Sync>;
|
let engine_out: Arc<dyn IoEngine + Send + Sync>;
|
||||||
|
|
||||||
if opts.async_io {
|
if opts.async_io {
|
||||||
engine_in = Arc::new(AsyncIoEngine::new(opts.input, MAX_CONCURRENT_IO, true)?);
|
engine_in = Arc::new(AsyncIoEngine::new(opts.input, MAX_CONCURRENT_IO, false)?);
|
||||||
engine_out = Arc::new(AsyncIoEngine::new(opts.output, MAX_CONCURRENT_IO, true)?);
|
engine_out = Arc::new(AsyncIoEngine::new(opts.output, MAX_CONCURRENT_IO, true)?);
|
||||||
} else {
|
} else {
|
||||||
let nr_threads = std::cmp::max(8, num_cpus::get() * 2);
|
let nr_threads = std::cmp::max(8, num_cpus::get() * 2);
|
||||||
engine_in = Arc::new(SyncIoEngine::new(opts.input, nr_threads, true)?);
|
engine_in = Arc::new(SyncIoEngine::new(opts.input, nr_threads, false)?);
|
||||||
engine_out = Arc::new(SyncIoEngine::new(opts.output, nr_threads, true)?);
|
engine_out = Arc::new(SyncIoEngine::new(opts.output, nr_threads, true)?);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user