fix trash and additional bugs
This commit is contained in:
@@ -17,6 +17,14 @@ pub struct FileSystemI18nService {
|
||||
}
|
||||
|
||||
impl FileSystemI18nService {
|
||||
/// Create a dummy service for testing
|
||||
pub fn dummy() -> Self {
|
||||
Self {
|
||||
translations_dir: PathBuf::from("/tmp/dummy_translations"),
|
||||
cache: RwLock::new(HashMap::new()),
|
||||
}
|
||||
}
|
||||
|
||||
/// Creates a new file system i18n service
|
||||
pub fn new(translations_dir: PathBuf) -> Self {
|
||||
Self {
|
||||
|
||||
@@ -9,7 +9,7 @@ use serde::{Serialize, Deserialize};
|
||||
use async_trait::async_trait;
|
||||
|
||||
use crate::domain::services::path_service::StoragePath;
|
||||
use crate::common::errors::{DomainError, ErrorKind, ErrorContext};
|
||||
use crate::common::errors::{DomainError, ErrorKind};
|
||||
use crate::application::ports::outbound::IdMappingPort;
|
||||
use crate::common::config::TimeoutConfig;
|
||||
|
||||
@@ -97,6 +97,19 @@ impl IdMappingService {
|
||||
}
|
||||
|
||||
/// Crea un servicio de mapeo de IDs en memoria (para pruebas)
|
||||
///
|
||||
/// Similar functionality as new_in_memory but with a simpler signature for dummy use
|
||||
pub fn dummy() -> Self {
|
||||
Self {
|
||||
map_path: PathBuf::from("/tmp/dummy_id_map.json"),
|
||||
id_map: RwLock::new(IdMap::default()),
|
||||
save_mutex: Mutex::new(()),
|
||||
timeouts: TimeoutConfig::default(),
|
||||
pending_save: RwLock::new(false),
|
||||
}
|
||||
}
|
||||
|
||||
/// Crea un servicio de mapeo de IDs en memoria (para pruebas - versión original)
|
||||
pub fn new_in_memory() -> Self {
|
||||
Self {
|
||||
map_path: PathBuf::from("memory"),
|
||||
|
||||
Reference in New Issue
Block a user