From 6bfc7ee06dc1a598014dd5bec659b14a3aa87bbd Mon Sep 17 00:00:00 2001 From: Benedikt Peetz Date: Thu, 22 Aug 2024 14:22:13 +0200 Subject: feat(download): Support limiting the downloader by maximal cache size --- src/main.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/main.rs') diff --git a/src/main.rs b/src/main.rs index c223140..ebbb45f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -8,13 +8,14 @@ // You should have received a copy of the License along with this program. // If not, see . -use std::{collections::HashMap, fs}; +use std::{collections::HashMap, fs, sync::Arc}; use anyhow::{bail, Context, Result}; use app::App; use cache::invalidate; use clap::Parser; use cli::{CacheCommand, CheckCommand, SelectCommand, SubscriptionCommand}; +use log::info; use select::cmds::handle_select_cmd; use tokio::{ fs::File, @@ -56,7 +57,12 @@ async fn main() -> Result<()> { let app = App::new(args.db_path.unwrap_or(constants::database()?)).await?; match args.command.unwrap_or(Command::default()) { - Command::Download { force } => { + Command::Download { + force, + max_cache_size, + } => { + info!("max cache size: '{}'", max_cache_size); + if force { invalidate(&app, true).await?; } -- cgit 1.4.1