Add rocksdb

This commit is contained in:
2025-10-26 00:28:24 +08:00
parent 5c466d37e9
commit 9f6c81471e
15 changed files with 424 additions and 266 deletions

View File

@@ -0,0 +1,22 @@
pub mod db;
use tokio::fs;
use crate::constants::{APP_CONFIG_DIR, APP_DATA_DIR, APP_DB_DATA_DIR};
use crate::crawler::DLSITE_IMG_FOLDER;
pub async fn initialize_folders() -> color_eyre::Result<()> {
if !APP_CONFIG_DIR.exists() {
fs::create_dir_all(APP_CONFIG_DIR.as_path()).await?;
}
if !APP_DATA_DIR.exists() {
fs::create_dir_all(APP_DATA_DIR.as_path()).await?;
}
if !DLSITE_IMG_FOLDER.exists() {
fs::create_dir_all(DLSITE_IMG_FOLDER.as_path()).await?;
}
if !APP_DB_DATA_DIR.exists() {
fs::create_dir_all(APP_DB_DATA_DIR.as_path()).await?;
}
Ok(())
}