Commit 2dfba491 authored by Stavros Korokithakis's avatar Stavros Korokithakis

Don't require the nightly compiler any more

parent b343c270
......@@ -16,14 +16,14 @@ use std::sync::Mutex;
use std::collections::HashMap;
use std::env;
use std::time::Duration;
use std::sync::atomic::{AtomicBool, Ordering};
use std::sync::mpsc::channel;
use std::thread;
use std::process;
use std::process::Command;
static DEBOUNCING_DONE: AtomicBool = AtomicBool::new(true);
lazy_static! {
static ref DEBOUNCING_DONE: Mutex<bool> = Mutex::new(true);
}
lazy_static! {
static ref IPFS_PID: Mutex<u32> = Mutex::new(0);
......@@ -83,13 +83,16 @@ fn notify_ipfs(add_to_ipfs: bool) {
// This does the proper debouncing (on top of the inotify debouncer) to emit the necessary
// messages to the console when we are expecting changes/are done with changes.
let mut debouncing_done = DEBOUNCING_DONE.lock().unwrap();
if add_to_ipfs {
add_files_to_ipfs();
println!("Finished adding files to IPFS.\n");
DEBOUNCING_DONE.store(true, Ordering::Relaxed);
} else if DEBOUNCING_DONE.load(Ordering::Relaxed) == true {
*debouncing_done = true;
} else if *debouncing_done == true {
println!("Change detected in filesystem.");
DEBOUNCING_DONE.store(false, Ordering::Relaxed);
*debouncing_done = false;
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment