INNER CODE UNIT · Rust
connect
zly2006/zhihu-plus-plus · aigc-vote-server/src/lib.rs:662
async fn connect(
database_url: &str,
credit_bypass_voters: HashSet<String>,
) -> Result<Self, ServiceError> {
let pool = PgPoolOptions::new()
.max_connections(10)
.connect(database_url)
.await?;
initialize_postgres_schema(&pool).await?;
Ok(Self {
pool,
credit_bypass_voters: normalize_identity_tokens(credit_bypass_voters),
})
}
}
#[async_trait]
impl VoteStore for PostgresVoteStore {