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

Commit

Permalink
Merge pull request #1269 from cloudflare/avery/remove-redundant-builds
Browse files Browse the repository at this point in the history
removes redundant builds when watching
  • Loading branch information
EverlastingBugstopper authored May 15, 2020
2 parents b0f43b0 + 089d3b9 commit 5b3a641
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
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

0 comments on commit 5b3a641

Please sign in to comment.