From a9e5a94920fcd1a2997e79c5dc2fc882a0029f89 Mon Sep 17 00:00:00 2001 From: Alex Snaps Date: Tue, 14 May 2024 14:53:35 -0400 Subject: [PATCH] Ignore distributed storage when targetting wasm32 --- limitador/src/storage/atomic_expiring_value.rs | 2 ++ limitador/src/storage/mod.rs | 2 ++ 2 files changed, 4 insertions(+) diff --git a/limitador/src/storage/atomic_expiring_value.rs b/limitador/src/storage/atomic_expiring_value.rs index c42b7656..e0967fff 100644 --- a/limitador/src/storage/atomic_expiring_value.rs +++ b/limitador/src/storage/atomic_expiring_value.rs @@ -134,10 +134,12 @@ impl AtomicExpiryTime { Ok(()) } + #[allow(dead_code)] pub fn into_inner(self) -> SystemTime { self.expires_at() } + #[allow(dead_code)] pub fn expires_at(&self) -> SystemTime { SystemTime::UNIX_EPOCH + Duration::from_micros(self.expiry.load(Ordering::SeqCst)) } diff --git a/limitador/src/storage/mod.rs b/limitador/src/storage/mod.rs index 25c66f96..70aab7c9 100644 --- a/limitador/src/storage/mod.rs +++ b/limitador/src/storage/mod.rs @@ -8,10 +8,12 @@ use thiserror::Error; #[cfg(feature = "disk_storage")] pub mod disk; +#[cfg(not(target_arch = "wasm32"))] pub mod distributed; pub mod in_memory; pub mod wasm; +#[cfg(not(target_arch = "wasm32"))] pub use crate::storage::distributed::CrInMemoryStorage as DistributedInMemoryStorage; #[cfg(feature = "redis_storage")]