Skip to content

Commit be80566

Browse files
Merge pull request #351 from QuietMisdreavus/daemon-lock
don't check new crates if lock file exists
2 parents 70e5a44 + b40db55 commit be80566

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/utils/daemon.rs

+8-4
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,14 @@ pub fn start_daemon() {
5353
let opts = opts();
5454
let mut doc_builder = DocBuilder::new(opts);
5555

56-
debug!("Checking new crates");
57-
match doc_builder.get_new_crates() {
58-
Ok(n) => debug!("{} crates added to queue", n),
59-
Err(e) => error!("Failed to get new crates: {}", e),
56+
if doc_builder.is_locked() {
57+
debug!("Lock file exists, skipping checking new crates");
58+
} else {
59+
debug!("Checking new crates");
60+
match doc_builder.get_new_crates() {
61+
Ok(n) => debug!("{} crates added to queue", n),
62+
Err(e) => error!("Failed to get new crates: {}", e),
63+
}
6064
}
6165

6266
thread::sleep(Duration::from_secs(60));

0 commit comments

Comments
 (0)