Skip to content

Commit f222804

Browse files
committed
Update sources before build
1 parent 0222cd3 commit f222804

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/utils/daemon.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ use libc::fork;
1313
use time;
1414
use DocBuilderOptions;
1515
use DocBuilder;
16+
use utils::{update_sources, update_release_activity};
1617

1718

1819
const DAEMON_PID_FILE_PATH: &'static str = "/var/run/cratesfyi.pid";
@@ -66,6 +67,13 @@ pub fn start_daemon() {
6667
// check lock file
6768
if opts.prefix.join("cratesfyi.lock").exists() {
6869
warn!("Lock file exits, skipping building new crates");
70+
continue;
71+
}
72+
73+
// update index
74+
if let Err(e) = update_sources() {
75+
error!("Failed to update sources: {}", e);
76+
continue;
6977
}
7078

7179
let mut doc_builder = DocBuilder::new(opts);
@@ -93,7 +101,7 @@ pub fn start_daemon() {
93101
let now = time::now();
94102
if now.tm_hour == 2 && now.tm_min == 0 {
95103
info!("Updating release activity");
96-
if let Err(e) = ::utils::update_release_activity() {
104+
if let Err(e) = update_release_activity() {
97105
error!("Failed to update release activity: {}", e);
98106
}
99107
}

0 commit comments

Comments
 (0)