Fix ownership issue by making LivestreamArchiver borrow the output path
This commit is contained in:
parent
8f98a688f1
commit
8fbc43a9ef
|
@ -25,7 +25,7 @@ async fn main() -> Result<()> {
|
||||||
println!("Watching directory: {}", watch_path.display());
|
println!("Watching directory: {}", watch_path.display());
|
||||||
println!("Output directory: {}", output_path.display());
|
println!("Output directory: {}", output_path.display());
|
||||||
|
|
||||||
let archiver = LivestreamArchiver::new(output_path);
|
let archiver = LivestreamArchiver::new(&output_path);
|
||||||
let processed_files = Arc::new(Mutex::new(HashSet::new()));
|
let processed_files = Arc::new(Mutex::new(HashSet::new()));
|
||||||
|
|
||||||
// Process existing files first
|
// Process existing files first
|
||||||
|
|
|
@ -4,12 +4,12 @@ use chrono::NaiveDateTime;
|
||||||
use tokio::process::Command;
|
use tokio::process::Command;
|
||||||
use tokio::time::Duration;
|
use tokio::time::Duration;
|
||||||
|
|
||||||
pub struct LivestreamArchiver {
|
pub struct LivestreamArchiver<'a> {
|
||||||
output_path: PathBuf,
|
output_path: &'a PathBuf,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl LivestreamArchiver {
|
impl<'a> LivestreamArchiver<'a> {
|
||||||
pub fn new(output_path: PathBuf) -> Self {
|
pub fn new(output_path: &'a PathBuf) -> Self {
|
||||||
LivestreamArchiver {
|
LivestreamArchiver {
|
||||||
output_path,
|
output_path,
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue