(app: &mut App)
| 69 | |
| 70 | #[tracing::instrument(level = "debug", skip(app))] |
| 71 | pub fn get_cache_state(app: &mut App) -> CacheHolder { |
| 72 | let path = app.path().app_cache_dir().unwrap().join("http_cache.db"); |
| 73 | if let Some(parent) = path.parent() { |
| 74 | if !parent.exists() { |
| 75 | fs::create_dir_all(parent).unwrap(); |
| 76 | } |
| 77 | } |
| 78 | |
| 79 | CacheHolder::new(path) |
| 80 | } |
| 81 | |
| 82 | #[tracing::instrument(level = "debug", skip(app))] |
| 83 | pub fn get_db_state(app: &mut App) -> Database { |