Fix cache bug

This commit is contained in:
Xyon 2023-09-20 23:22:30 +01:00
parent be130790ea
commit 0b2e2bcb4a
Signed by: xyon
GPG Key ID: DD18155D6B18078D
1 changed files with 3 additions and 2 deletions

View File

@ -1,3 +1,4 @@
use std::env::temp_dir;
use std::fmt::Debug;
use std::fs;
use std::path::PathBuf;
@ -38,8 +39,7 @@ impl FuelTank {
U: DeserializeOwned, U: Pump<T>
{
let path = PathBuf::new()
.join(home_dir().ok_or(ManifoldError::from("No home dir"))?)
.join(".local")
.join(temp_dir())
.join(format!("manifold-{}-cache-{}.json", self.cache_name.clone().unwrap(), CACHE_VERSION));
let mut fuel = match self.cache_mode {
@ -50,6 +50,7 @@ impl FuelTank {
debug!("Cache path: {:?}", &path);
fs::OpenOptions::new()
.read(true)
.write(true)
.create(true)
.open(&path)
.map_err(|e| {