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

@ -9,9 +9,9 @@ edition = "2021"
actix.workspace = true
actix-web.workspace = true
actix-http = { workspace = true, default-features = false, features = [
"openssl",
"compress-brotli",
"compress-gzip",
"openssl",
"compress-brotli",
"compress-gzip",
] }
actix-rt = "2.9.0"
actix-web-actors = { version = "4.3" }
@ -28,20 +28,20 @@ serde_repr.workspace = true
serde.workspace = true
tokio = { workspace = true, features = [
"macros",
"rt-multi-thread",
"sync",
"fs",
"time",
"full",
"macros",
"rt-multi-thread",
"sync",
"fs",
"time",
"full",
] }
tokio-stream.workspace = true
tokio-util = { version = "0.7.10", features = ["io"] }
futures-util = { workspace = true, features = ["std", "io"] }
once_cell = "1.19.0"
chrono = { version = "0.4.37", features = [
"serde",
"clock",
"serde",
"clock",
], default-features = false }
derive_more = { version = "0.99" }
secrecy.workspace = true
@ -49,10 +49,10 @@ rand = { version = "0.8", features = ["std_rng"] }
anyhow = "1.0.79"
thiserror = "1.0.56"
reqwest = { workspace = true, features = [
"json",
"rustls-tls",
"cookies",
"stream",
"json",
"rustls-tls",
"cookies",
"stream",
] }
unicode-segmentation = "1.10"
lazy_static.workspace = true
@ -62,31 +62,31 @@ bytes = "1.5.0"
rcgen = { version = "0.10.0", features = ["pem", "x509-parser"] }
mime = "0.3.17"
aws-sdk-s3 = { version = "1.36.0", features = [
"behavior-version-latest",
"rt-tokio",
"behavior-version-latest",
"rt-tokio",
] }
aws-config = { version = "1.5.1", features = ["behavior-version-latest"] }
redis = { workspace = true, features = [
"json",
"tokio-comp",
"connection-manager",
"json",
"tokio-comp",
"connection-manager",
] }
tracing = { version = "0.1.40", features = ["log"] }
tracing-subscriber = { version = "0.3.18", features = [
"registry",
"env-filter",
"ansi",
"json",
"tracing-log",
"registry",
"env-filter",
"ansi",
"json",
"tracing-log",
] }
tracing-bunyan-formatter = "0.3.9"
sqlx = { workspace = true, default-features = false, features = [
"runtime-tokio-rustls",
"macros",
"postgres",
"uuid",
"chrono",
"migrate",
"runtime-tokio-rustls",
"macros",
"postgres",
"uuid",
"chrono",
"migrate",
] }
async-trait.workspace = true
prometheus-client.workspace = true
@ -129,10 +129,10 @@ infra = { path = "libs/infra" }
authentication.workspace = true
access-control.workspace = true
app-error = { workspace = true, features = [
"sqlx_error",
"actix_web_error",
"tokio_error",
"appflowy_ai_error",
"sqlx_error",
"actix_web_error",
"tokio_error",
"appflowy_ai_error",
] }
shared-entity = { path = "libs/shared-entity", features = ["cloud"] }
workspace-template = { workspace = true }
@ -165,11 +165,11 @@ assert-json-diff = "2.0.2"
scraper = "0.17.1"
client-api-test = { path = "libs/client-api-test", features = ["collab-sync"] }
client-api = { path = "libs/client-api", features = [
"collab-sync",
"test_util",
"sync_verbose_log",
"test_fast_sync",
"enable_brotli",
"collab-sync",
"test_util",
"sync_verbose_log",
"test_fast_sync",
"enable_brotli",
] }
opener = "0.6.1"
image = "0.23.14"
@ -191,37 +191,37 @@ path = "src/lib.rs"
[workspace]
members = [
# libs
"libs/snowflake",
"libs/collab-rt-entity",
"libs/database",
"libs/database-entity",
"libs/client-api",
"libs/infra",
"libs/shared-entity",
"libs/gotrue",
"libs/gotrue-entity",
"admin_frontend",
"libs/app-error",
"libs/workspace-template",
"libs/encrypt",
"libs/authentication",
"libs/access-control",
"libs/collab-rt-protocol",
"libs/collab-stream",
"libs/client-websocket",
"libs/client-api-test",
"libs/wasm-test",
"libs/client-api-wasm",
"libs/appflowy-ai-client",
"libs/client-api-entity",
# services
"services/appflowy-collaborate",
"services/appflowy-worker",
# xtask
"xtask",
"libs/tonic-proto",
"libs/mailer",
# libs
"libs/snowflake",
"libs/collab-rt-entity",
"libs/database",
"libs/database-entity",
"libs/client-api",
"libs/infra",
"libs/shared-entity",
"libs/gotrue",
"libs/gotrue-entity",
"admin_frontend",
"libs/app-error",
"libs/workspace-template",
"libs/encrypt",
"libs/authentication",
"libs/access-control",
"libs/collab-rt-protocol",
"libs/collab-stream",
"libs/client-websocket",
"libs/client-api-test",
"libs/wasm-test",
"libs/client-api-wasm",
"libs/appflowy-ai-client",
"libs/client-api-entity",
# services
"services/appflowy-collaborate",
"services/appflowy-worker",
# xtask
"xtask",
"libs/tonic-proto",
"libs/mailer",
]
[workspace.dependencies]
@ -250,9 +250,9 @@ uuid = { version = "1.6.1", features = ["v4", "v5"] }
anyhow = "1.0.79"
actix = "0.13.3"
actix-web = { version = "4.5.1", default-features = false, features = [
"openssl",
"compress-brotli",
"compress-gzip",
"openssl",
"compress-brotli",
"compress-gzip",
] }
actix-http = { version = "3.6.0", default-features = false }
tokio = { version = "1.36.0", features = ["sync"] }

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