Skip to content

Commit

Permalink
Ignore distributed storage when targetting wasm32
Browse files Browse the repository at this point in the history
  • Loading branch information
alexsnaps committed May 14, 2024
1 parent 33d9762 commit a9e5a94
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions limitador/src/storage/atomic_expiring_value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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))
}
Expand Down
2 changes: 2 additions & 0 deletions limitador/src/storage/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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")]
Expand Down

0 comments on commit a9e5a94

Please sign in to comment.