Skip to content

Commit 3c113a0

Browse files
committed
fix: final timezone fix please?
1 parent 7d78735 commit 3c113a0

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

src/main.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
use async_graphql::EmptySubscription;
22
use axum::http::{HeaderValue, Method};
3+
use sqlx::Executor;
34
use sqlx::PgPool;
45
use std::sync::Arc;
56
use time::UtcOffset;
@@ -114,6 +115,12 @@ async fn setup_database(database_url: &str) -> Arc<PgPool> {
114115
let pool = sqlx::postgres::PgPoolOptions::new()
115116
.min_connections(2)
116117
.max_connections(3)
118+
.after_connect(|conn, _meta| {
119+
Box::pin(async move {
120+
conn.execute("SET TIME ZONE 'Asia/Kolkata';").await?;
121+
Ok(())
122+
})
123+
})
117124
.connect(database_url)
118125
.await
119126
.expect("Pool must be initialized properly.");

0 commit comments

Comments
 (0)