+3
-24
src/main.rs
+3
-24
src/main.rs
···
17
17
path::PathBuf,
18
18
sync::Arc,
19
19
};
20
-
use xdg::BaseDirectories;
21
20
22
21
fn main() {
23
22
let rt = tokio::runtime::Runtime::new().unwrap();
···
117
116
pb.enable_steady_tick(std::time::Duration::from_millis(100));
118
117
pb = m.add(pb);
119
118
120
-
let dirs = BaseDirectories::new();
121
-
122
-
let dir = dirs
123
-
.get_cache_home()
124
-
.expect("$HOME is absent")
125
-
.join("pdsfs");
126
-
tokio::fs::create_dir_all(&dir).await?;
127
-
128
-
let file = dir.join(&id.did);
129
-
let exists = std::fs::exists(&file)?;
130
-
131
-
let bytes = if !exists {
132
-
pb.set_message(format!("downloading CAR file for...{}", id.did));
133
-
download_car_file(id, &pb).await?
134
-
} else {
135
-
pb.set_message(format!("using cached CAR file for...{}", id.did));
136
-
tokio::fs::read(&file).await?
137
-
};
138
-
139
-
// write to disk
140
-
if !exists {
141
-
tokio::fs::write(&file, &bytes).await?;
142
-
}
119
+
// Always download fresh - no caching for now to ensure up-to-date data
120
+
pb.set_message(format!("downloading CAR file for...{}", id.did));
121
+
let bytes = download_car_file(id, &pb).await?;
143
122
144
123
pb.finish();
145
124
Ok(bytes)