Skip to content

Commit

Permalink
disable watch logic temporarily
Browse files Browse the repository at this point in the history
  • Loading branch information
johnnynotsolucky committed Aug 17, 2023
1 parent f6ddf4e commit b8b93bd
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 19 deletions.
37 changes: 19 additions & 18 deletions sluggy/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,24 +140,25 @@ impl Command {
}
}
});

let watch_handle = tokio::spawn({
let server_config = server_config.clone();
async move {
if server_config.clone().watch {
if let Err(error) = watcher.watch().await {
println!("Error: {error}");
}
} else {
futures::pending!()
}
}
});

select! {
_ = serve_handle => {},
_ = watch_handle => {},
}
serve_handle.await?

// let watch_handle = tokio::spawn({
// let server_config = server_config.clone();
// async move {
// if server_config.clone().watch {
// if let Err(error) = watcher.watch().await {
// println!("Error: {error}");
// }
// } else {
// futures::pending!()
// }
// }
// });
//
// select! {
// _ = serve_handle => {},
// _ = watch_handle => {},
// }
}
}

Expand Down
2 changes: 1 addition & 1 deletion sluggy_core/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ pub type Result<T> = StdResult<T, Error>;
pub enum Error {
#[error("json pointer error")]
JsonPointer(#[from] JsonPointerError),
#[error("notify error")]
#[error(transparent)]
NotifyError(#[from] NotifyError),
#[error("join error")]
JoinError(#[from] JoinError),
Expand Down

0 comments on commit b8b93bd

Please sign in to comment.