warn for variable values delays

This commit is contained in:
Ruben Fiszel
2025-09-09 22:16:51 +00:00
parent 44711db8ac
commit de273ebb5d
2 changed files with 3 additions and 8 deletions
+1
View File
@@ -823,6 +823,7 @@ pub async fn get_value_internal<'a, 'e, A: sqlx::Acquire<'e, Database = Postgres
if variable.is_expired.unwrap_or(false) && variable.account.is_some() {
#[cfg(feature = "oauth2")]
{
let tx = db.begin().await?;
crate::oauth2_oss::_refresh_token(
tx,
&variable.path,
+2 -8
View File
@@ -1,7 +1,5 @@
use sqlx::{Acquire, Pool, Postgres, Transaction};
use crate::db;
pub type DB = Pool<Postgres>;
#[derive(Clone, Debug, Hash)]
@@ -123,8 +121,6 @@ impl<'c, 'd, T: Authable + Sync> Acquire<'c> for &'c UserDbWithAuthed<'d, T> {
}
}
pub struct UserDbWithOptAuthed<'c, T: Authable + Sync> {
pub authed: &'c T,
pub user_db: Option<UserDB>,
@@ -136,7 +132,7 @@ impl<'c, 'd, T: Authable + Sync> Acquire<'c> for &'c UserDbWithOptAuthed<'d, T>
type Connection = Transaction<'c, Postgres>;
fn acquire(self) -> futures_core::future::BoxFuture<'c, Result<Self::Connection, sqlx::Error>> {
Box::pin(async move {
Box::pin(async move {
if let Some(db) = &self.user_db {
db.clone().begin(self.authed).await
} else {
@@ -145,11 +141,10 @@ impl<'c, 'd, T: Authable + Sync> Acquire<'c> for &'c UserDbWithOptAuthed<'d, T>
})
}
fn begin(
self,
) -> futures_core::future::BoxFuture<'c, Result<Transaction<'c, Postgres>, sqlx::Error>> {
Box::pin(async move {
Box::pin(async move {
if let Some(db) = &self.user_db {
db.clone().begin(self.authed).await
} else {
@@ -159,7 +154,6 @@ impl<'c, 'd, T: Authable + Sync> Acquire<'c> for &'c UserDbWithOptAuthed<'d, T>
}
}
impl UserDB {
pub fn new(db: DB) -> Self {
Self { db }