chore: fix issues mentioned in nathan review

This commit is contained in:
Bartosz Sypytkowski 2024-10-23 12:13:26 +02:00
parent 53b7f4c15a
commit 82f348271f
4 changed files with 82 additions and 81 deletions

View File

@ -3,6 +3,7 @@ use async_trait::async_trait;
use redis::aio::ConnectionManager;
use redis::Value;
use std::time::{Duration, SystemTime, UNIX_EPOCH};
use tracing::log;
const RELEASE_SCRIPT: &str = r#"
if redis.call("GET", KEYS[1]) == ARGV[1] then
@ -45,11 +46,11 @@ impl LeaseAcquisition {
impl Drop for LeaseAcquisition {
fn drop(&mut self) {
if let Some(conn) = self.conn.take() {
tokio::spawn(Self::release_internal(
conn,
self.stream_key.clone(),
self.token,
));
tokio::spawn(async move {
if let Err(err) = Self::release_internal(conn, self.stream_key.clone(), self.token).await {
log::error!("error while releasing lease (drop): {}", err);
}
});
}
}
}

View File

@ -583,7 +583,7 @@ impl From<u8> for UpdateFlags {
impl Display for UpdateFlags {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
if self.is_v2_encoded() {
if !self.is_v2_encoded() {
write!(f, ".v1")?;
} else {
write!(f, ".v2")?;

View File

@ -53,7 +53,7 @@ then
cargo sqlx prepare --workspace
fi
cargo run --release --package xtask
cargo run --package xtask
# revert to require signup email verification
export GOTRUE_MAILER_AUTOCONFIRM=false