chore: fix issues mentioned in nathan review
This commit is contained in:
parent
53b7f4c15a
commit
82f348271f
|
|
@ -3,6 +3,7 @@ use async_trait::async_trait;
|
||||||
use redis::aio::ConnectionManager;
|
use redis::aio::ConnectionManager;
|
||||||
use redis::Value;
|
use redis::Value;
|
||||||
use std::time::{Duration, SystemTime, UNIX_EPOCH};
|
use std::time::{Duration, SystemTime, UNIX_EPOCH};
|
||||||
|
use tracing::log;
|
||||||
|
|
||||||
const RELEASE_SCRIPT: &str = r#"
|
const RELEASE_SCRIPT: &str = r#"
|
||||||
if redis.call("GET", KEYS[1]) == ARGV[1] then
|
if redis.call("GET", KEYS[1]) == ARGV[1] then
|
||||||
|
|
@ -45,11 +46,11 @@ impl LeaseAcquisition {
|
||||||
impl Drop for LeaseAcquisition {
|
impl Drop for LeaseAcquisition {
|
||||||
fn drop(&mut self) {
|
fn drop(&mut self) {
|
||||||
if let Some(conn) = self.conn.take() {
|
if let Some(conn) = self.conn.take() {
|
||||||
tokio::spawn(Self::release_internal(
|
tokio::spawn(async move {
|
||||||
conn,
|
if let Err(err) = Self::release_internal(conn, self.stream_key.clone(), self.token).await {
|
||||||
self.stream_key.clone(),
|
log::error!("error while releasing lease (drop): {}", err);
|
||||||
self.token,
|
}
|
||||||
));
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -583,7 +583,7 @@ impl From<u8> for UpdateFlags {
|
||||||
|
|
||||||
impl Display for UpdateFlags {
|
impl Display for UpdateFlags {
|
||||||
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
|
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
|
||||||
if self.is_v2_encoded() {
|
if !self.is_v2_encoded() {
|
||||||
write!(f, ".v1")?;
|
write!(f, ".v1")?;
|
||||||
} else {
|
} else {
|
||||||
write!(f, ".v2")?;
|
write!(f, ".v2")?;
|
||||||
|
|
|
||||||
|
|
@ -53,7 +53,7 @@ then
|
||||||
cargo sqlx prepare --workspace
|
cargo sqlx prepare --workspace
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cargo run --release --package xtask
|
cargo run --package xtask
|
||||||
|
|
||||||
# revert to require signup email verification
|
# revert to require signup email verification
|
||||||
export GOTRUE_MAILER_AUTOCONFIRM=false
|
export GOTRUE_MAILER_AUTOCONFIRM=false
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue