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