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

Commit

Permalink
removes redundant builds when watching
Browse files Browse the repository at this point in the history
  • Loading branch information
EverlastingBugstopper committed May 11, 2020
1 parent f1202a0 commit e38a851
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
5 changes: 4 additions & 1 deletion src/commands/build/watch/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,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
1 change: 0 additions & 1 deletion src/commands/dev/gcs/watch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ pub fn watch_for_changes(
while let Ok(_) = receiver.recv() {
let user = user.clone();
let target = target.clone();
commands::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/commands/preview/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -169,9 +169,7 @@ fn watch_for_changes(
let (tx, rx) = channel();
commands::watch_and_build(&target, Some(tx))?;

while let Ok(_e) = rx.recv() {
commands::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

0 comments on commit e38a851

Please sign in to comment.