Skip to content

Commit 7ddad2d

Browse files
committed
Write extraction marker for mongo
1 parent 7f8ea62 commit 7ddad2d

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

nativelink-store/tests/mongo_runner/mod.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ pub(crate) mod extractor;
55
pub(crate) mod process;
66

77
use core::time::Duration;
8+
use std::fs;
89
use std::path::PathBuf;
910
use std::sync::{Condvar, LazyLock, Mutex};
1011

@@ -110,9 +111,10 @@ impl MongoEmbedded {
110111
callback(InitStatus::ValidatingInstallation);
111112

112113
let extract_target = self.extract_path.join(self.version.as_str());
114+
let extract_marker = extract_target.join("extracted.marker");
113115

114-
if extract_target.exists() {
115-
info!(?extract_target, "Already have Mongo downloaded");
116+
if extract_marker.exists() {
117+
info!(?extract_marker, "Already have Mongo downloaded");
116118
} else {
117119
let existing_downloader = {
118120
let mut lock = CURRENTLY_DOWNLOADING.0.lock().unwrap();
@@ -128,7 +130,7 @@ impl MongoEmbedded {
128130
};
129131
if !existing_downloader {
130132
if !self.download_path.exists() {
131-
std::fs::create_dir_all(&self.download_path)
133+
fs::create_dir_all(&self.download_path)
132134
.err_tip(|| format!("Making {}", self.download_path.display()))?;
133135
}
134136
callback(InitStatus::Downloading);
@@ -153,6 +155,7 @@ impl MongoEmbedded {
153155
)
154156
})?;
155157
info!("Downloaded, notifying");
158+
fs::write(extract_marker, "")?;
156159
let lock = CURRENTLY_DOWNLOADING.0.lock().unwrap();
157160
CURRENTLY_DOWNLOADING.1.notify_all();
158161
drop(lock);

0 commit comments

Comments
 (0)