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