Skip to content
This repository has been archived by the owner on Aug 3, 2023. It is now read-only.

removes redundant builds when watching #1269

Merged
merged 4 commits into from
May 15, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/commands/dev/gcs/watch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ pub fn watch_for_changes(
while let Ok(_) = receiver.recv() {
let user = user.clone();
let target = target.clone();
build(&target)?;

// acquire the lock so incoming requests are halted
// until the new script is ready for them
Expand Down
4 changes: 1 addition & 3 deletions src/preview/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -181,9 +181,7 @@ fn watch_for_changes(
let (tx, rx) = channel();
watch_and_build(&target, Some(tx))?;

while let Ok(_e) = rx.recv() {
build(&target)?;

while let Ok(_) = rx.recv() {
if let Ok(new_id) = upload(&mut target, user, sites_preview, verbose) {
let script_id = format!("{}", new_id);

Expand Down
5 changes: 4 additions & 1 deletion src/watch/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,10 @@ pub fn watch_and_build(
tx.send(()).expect("--watch change message failed to send");
}
}
Err(_) => message::user_error("Something went wrong while watching."),
Err(e) => {
log::debug!("{:?}", e);
message::user_error("Something went wrong while watching.")
}
}
}
});
Expand Down