Skip to content

Commit

Permalink
remove setup calls
Browse files Browse the repository at this point in the history
  • Loading branch information
maxcountryman committed Oct 1, 2023
1 parent b03ee01 commit c843c59
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 7 deletions.
3 changes: 0 additions & 3 deletions examples/mongodb-store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,7 @@ struct Counter(usize);
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let database_url = std::option_env!("DATABASE_URL").expect("Missing DATABASE_URL.");
let client = mongodb::Client::with_uri_str(database_url).await.unwrap();

let session_store = MongoDBStore::new(client, "tower-sessions".to_string());
session_store.setup().await.unwrap();

let session_service = ServiceBuilder::new()
.layer(HandleErrorLayer::new(|_: BoxError| async {
StatusCode::BAD_REQUEST
Expand Down
4 changes: 0 additions & 4 deletions src/mongodb_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,7 @@ impl MongoDBStore {
/// # tokio_test::block_on(async {
/// let database_url = std::option_env!("DATABASE_URL").unwrap();
/// let client = Client::with_uri_str(database_url).await.unwrap();
///
/// let session_store = MongoDBStore::new(client, "database".to_string());
/// session_store.setup().await.unwrap();
/// # })
/// ```
pub fn new(client: Client, database: String) -> Self {
Expand Down Expand Up @@ -89,9 +87,7 @@ impl MongoDBStore {
/// # tokio_test::block_on(async {
/// let database_url = std::option_env!("DATABASE_URL").unwrap();
/// let client = Client::with_uri_str(database_url).await.unwrap();
///
/// let session_store = MongoDBStore::new(client, "database".to_string());
/// session_store.setup().await.unwrap();
///
/// tokio::task::spawn(
/// session_store
Expand Down

0 comments on commit c843c59

Please sign in to comment.