Skip to content

Commit 7b1be6f

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 02a1593 commit 7b1be6f

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/bin/background-worker.rs

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

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

81+
std::thread::spawn(move || {
82+
let environment = environment.clone();
83+
if let Err(err) = environment.lock_index() {
84+
warn!(%err, "Failed to clone index");
85+
};
86+
});
87+
8188
let connection_pool = r2d2::Pool::builder()
8289
.max_size(10)
8390
.min_idle(Some(0))

0 commit comments

Comments
 (0)