Compare commits

..

No commits in common. 'fae98150cd23158a9d08e3f9a3a565f4779a3ccf' and '7a0967741d9604bd8f246c0f7af2f50f1f17e4f9' have entirely different histories.

@ -8,18 +8,16 @@ use std::{
task::{Context, Poll},
sync::Arc,
thread::{JoinHandle, self},
net::SocketAddr,
io,
fmt,
error,
panic,
panic, net::SocketAddr,
};
use axum::{Router, Server, Extension};
use notify::{RecommendedWatcher, RecursiveMode, Watcher};
use tera::Tera;
use tokio::sync::RwLock as TokioRwLock;
use tracing::{debug, info, error};
use treacle::Debouncer;
const DEFAULT_TEMPLATES_DEBOUNCE_TIME: Duration = Duration::from_millis(500);
@ -106,7 +104,7 @@ impl<'a, F> Mallard<'a, F> {
},
Err(err) => {
// FIXME: custom error handler
error!(error = %err, "filesystem event error");
eprintln!("Filesystem event error: {}", err);
},
})?;
@ -120,25 +118,25 @@ impl<'a, F> Mallard<'a, F> {
move || {
while let Ok(()) = debounced_rx.recv() {
debug!("reloading templates");
// FIXME: tracing
let reload_res = {
let mut guard = ctx.tera().blocking_write();
guard.full_reload()
};
// FIXME: custom error handler
match reload_res {
Ok(()) => {
info!("reloaded templates");
// println!("Reloaded templates");
},
Err(err) => {
// FIXME: custom error handler
error!(error = %err, "failed to reload templates");
Err(_) => {
// eprintln!("Error reloading templates: {}", err);
},
}
}
info!("stopped template reloader thread")
// println!("Stopping template reloader thread");
}
})?;
@ -237,7 +235,7 @@ impl Drop for ReloadEngine {
}
}
pub struct BottomFuture<T> {
struct BottomFuture<T> {
bottom: Infallible,
phantom_data: PhantomData<T>,
}

Loading…
Cancel
Save