WIP create a handler to download a file chunk by chunk.

This commit is contained in:
Florian THIERRY
2026-07-14 00:13:47 +02:00
parent 850dbca6cf
commit c24df944c5
14 changed files with 413 additions and 83 deletions
+24 -24
View File
@@ -16,30 +16,30 @@ use surveillant_systeme_exposition::video::video_format_content_type_mapper::map
use surveillant_systeme_infrastructure::video::video_format_detector::get_content_type;
use tokio_cron_scheduler::{Job, JobScheduler};
// #[actix_web::main]
fn main() {
let path_str = "/home/florian/Videos/AirFly/GH010015.MP4";
let path = Path::new(path_str);
let file_type = get_content_type(&path);
let file_content_type = map_to_content_type(&file_type);
println!("file_type={file_content_type}");
()
// dotenv().ok();
// unsafe { env::set_var("RUST_LOG", "debug"); }
// check_all_variables_are_set();
// env_logger::init();
//
// let application_context = ApplicationContext::init()?;
//
// let tls_config = init_tls_configuration()?;
// let server = HttpServer::new(
// move || App::new().configure(init)
// .app_data(web::Data::new(Arc::new(application_context.user_service.clone())))
// )
// .bind_rustls_0_23(("0.0.0.0", 19000), tls_config)
// .expect("Unable to start server");
//
// server.run().await
#[actix_web::main]
async fn main() -> std::io::Result<()> {
// let path_str = "/home/florian/Videos/AirFly/GH010015.MP4";
// let path = Path::new(path_str);
// let file_type = get_content_type(&path);
// let file_content_type = map_to_content_type(&file_type);
// println!("file_type={file_content_type}");
// ()
dotenv().ok();
unsafe { env::set_var("RUST_LOG", "debug"); }
check_all_variables_are_set();
env_logger::init();
let application_context = ApplicationContext::init()?;
let tls_config = init_tls_configuration()?;
let server = HttpServer::new(
move || App::new().configure(init)
.app_data(web::Data::new(Arc::new(application_context.user_service.clone())))
)
.bind_rustls_0_23(("0.0.0.0", 19000), tls_config)
.expect("Unable to start server");
server.run().await
}
fn init_tls_configuration() -> Result<ServerConfig, Error> {