Skip to content

Commit

Permalink
ignore external stores for now
Browse files Browse the repository at this point in the history
  • Loading branch information
maxcountryman committed Jan 22, 2024
1 parent 5a959b8 commit f1fb1dd
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 13 deletions.
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
//! which is designed to be executed as a recurring task. This process ensures
//! the removal of expired sessions, maintaining your application's data
//! integrity and performance.
//! ```rust,no_run
//! ```rust,no_run,ignore
//! # use tower_sessions::{session_store::ExpiredDeletion};
//! # use tower_sessions_sqlx_store::{sqlx::SqlitePool, SqliteStore};
//! # tokio_test::block_on(async {
Expand Down Expand Up @@ -280,7 +280,7 @@
//! To illustrate, this is how we might use the
//! `MokaStore` as a frontend cache to a
//! `PostgresStore` backend.
//! ```rust,no_run
//! ```rust,no_run,ignore
//! # use tower::ServiceBuilder;
//! # use tower_sessions::{CachingSessionStore, SessionManagerLayer};
//! # use tower_sessions_sqlx_store::{sqlx::PgPool, PostgresStore};
Expand Down
8 changes: 7 additions & 1 deletion tower-sessions-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ async-trait = "0.1.73"
axum-core = { version = "0.4.0", optional = true }
base64 = "0.21.7"
futures = { version = "0.3.28", default-features = false, features = [
"async-await",
"async-await",
] }
http = "1.0"
parking_lot = { version = "0.12.1", features = ["serde"] }
Expand All @@ -35,4 +35,10 @@ tracing = { version = "0.1.40", features = ["log"] }

[dev-dependencies]
tower-sessions = { workspace = true }
tower-sessions-sqlx-store = { version = "0.9.2", features = [
"postgres",
"sqlite",
"mysql",
] }
tower-sessions-moka-store = { version = "0.9.1" }
tokio-test = "0.4.3"
18 changes: 8 additions & 10 deletions tower-sessions-core/src/session_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,17 +87,16 @@ pub trait SessionStore: Debug + Send + Sync + 'static {
///
/// # Examples
///
/// ```rust
/// # #[cfg(all(feature = "moka_store", feature = "sqlite_store"))]
/// # {
/// ```rust,ignore
/// # tokio_test::block_on(async {
/// use tower_sessions::{CachingSessionStore, MokaStore, SqlitePool, SqliteStore};
/// let pool = SqlitePool::connect("sqlite::memory:").await?;
/// use tower_sessions::CachingSessionStore;
/// use tower_sessions_moka_store::MokaStore;
/// use tower_sessions_sqlx_store::{SqlitePool, SqliteStore};
/// let pool = SqlitePool::connect("sqlite::memory:").await.unwrap();
/// let sqlite_store = SqliteStore::new(pool);
/// let moka_store = MokaStore::new(Some(2_000));
/// let caching_store = CachingSessionStore::new(moka_store, sqlite_store);
/// # })
/// # }
/// ```
#[derive(Debug, Clone)]
pub struct CachingSessionStore<Cache: SessionStore, Store: SessionStore> {
Expand Down Expand Up @@ -183,10 +182,10 @@ where
///
/// # Examples
///
/// ```rust,no_run
/// use tower_sessions::{session_store::ExpiredDeletion, sqlx::SqlitePool, SqliteStore};
/// ```rust,no_run,ignore
/// use tower_sessions::session_store::ExpiredDeletion;
/// use tower_sessions_sqlx_store::{sqlx::SqlitePool, SqliteStore};
///
/// # #[cfg(all(feature = "sqlite-store", feature = "deletion-task"))]
/// # {
/// # tokio_test::block_on(async {
/// let pool = SqlitePool::connect("sqlite::memory:").await.unwrap();
Expand All @@ -198,7 +197,6 @@ where
/// .continuously_delete_expired(tokio::time::Duration::from_secs(60)),
/// );
/// # })
/// # }
/// ```
#[cfg(feature = "deletion-task")]
#[cfg_attr(docsrs, doc(cfg(feature = "deletion-task")))]
Expand Down

0 comments on commit f1fb1dd

Please sign in to comment.