Skip to content

Commit f9a1b7d

Browse files
committed
bin/background-worker: Clone index Repository eagerly... but in the background
This commit moves us back to the previous behavior, where the index repository is cloned on startup. But compared to the previous behavior, the cloning is now happening in a background thread so that any background jobs that don't need the repository can run uninterrupted.
1 parent 3264faf commit f9a1b7d

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/bin/background-worker.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,15 @@ fn main() -> anyhow::Result<()> {
7878

7979
let environment = Arc::new(environment);
8080

81+
std::thread::spawn({
82+
let environment = environment.clone();
83+
move || {
84+
if let Err(err) = environment.lock_index() {
85+
warn!(%err, "Failed to clone index");
86+
};
87+
}
88+
});
89+
8190
let build_runner = || {
8291
let connection_pool = r2d2::Pool::builder()
8392
.max_size(10)

0 commit comments

Comments
 (0)