fix: commit code

This commit is contained in:
YuKun Liu committed 2022-03-28 10:13:58 +08:00
1 parent 48fb4a6632
commit a7991a32c5
1 file changed
+3 -3
+3 -3
View File
@@ -33,10 +33,9 @@ pub async fn startup(config: CrateConfig) -> Result<()> {
// file watcher: check file change // file watcher: check file change
let watcher_conf = config.clone(); let watcher_conf = config.clone();
let mut watcher = RecommendedWatcher::new(move |_: notify::Result<notify::Event>| { let mut watcher = RecommendedWatcher::new(move |_: notify::Result<notify::Event>| {
if chrono::Local::now().timestamp() > last_update_time {
log::info!("Start to rebuild project..."); log::info!("Start to rebuild project...");
if chrono::Local::now().timestamp() > last_update_time if builder::build(&watcher_conf).is_ok() {
&& builder::build(&watcher_conf).is_ok()
{
// change the websocket reload state to true; // change the websocket reload state to true;
// the page will auto-reload. // the page will auto-reload.
if watcher_conf if watcher_conf
@@ -51,6 +50,7 @@ pub async fn startup(config: CrateConfig) -> Result<()> {
let _ = reload_tx.send("reload".into()); let _ = reload_tx.send("reload".into());
last_update_time = chrono::Local::now().timestamp(); last_update_time = chrono::Local::now().timestamp();
} }
}
}) })
.unwrap(); .unwrap();
let allow_watch_path = config let allow_watch_path = config