chore: use rust 1.77 (#493)
This commit is contained in:
parent
9545dc82e6
commit
5f970a625a
|
|
@ -11,7 +11,7 @@ env:
|
|||
SQLX_VERSION: 0.7.1
|
||||
SQLX_FEATURES: "rustls,postgres"
|
||||
SQLX_OFFLINE: true
|
||||
RUST_TOOLCHAIN: "1.75"
|
||||
RUST_TOOLCHAIN: "1.77"
|
||||
|
||||
jobs:
|
||||
test:
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ on:
|
|||
|
||||
env:
|
||||
NODE_VERSION: '20.12.0'
|
||||
RUST_TOOLCHAIN: "1.75"
|
||||
RUST_TOOLCHAIN: "1.77"
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ on:
|
|||
|
||||
env:
|
||||
NODE_VERSION: '20.12.0'
|
||||
RUST_TOOLCHAIN: "1.75"
|
||||
RUST_TOOLCHAIN: "1.77"
|
||||
jobs:
|
||||
publish:
|
||||
runs-on: ubuntu-latest
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
# Using cargo-chef to manage Rust build cache effectively
|
||||
FROM lukemathwalker/cargo-chef:latest-rust-1.75.0 as chef
|
||||
FROM lukemathwalker/cargo-chef:latest-rust-1.77 as chef
|
||||
|
||||
WORKDIR /app
|
||||
RUN apt update && apt install lld clang -y
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# User should build from parent directory
|
||||
|
||||
FROM lukemathwalker/cargo-chef:latest-rust-1.75 as chef
|
||||
FROM lukemathwalker/cargo-chef:latest-rust-1.77 as chef
|
||||
|
||||
WORKDIR /app
|
||||
RUN apt update && apt install lld clang -y
|
||||
|
|
|
|||
|
|
@ -428,6 +428,7 @@ impl TestClient {
|
|||
timeout_secs: u64,
|
||||
) -> Result<AFSnapshotMetas, AppResponseError> {
|
||||
let duration = Duration::from_secs(timeout_secs);
|
||||
#[allow(clippy::blocks_in_conditions)]
|
||||
match timeout(duration, async {
|
||||
let mut snapshot_metas = self.get_snapshot_list(workspace_id, object_id).await?;
|
||||
// Loop until the condition `f` returns true or the timeout is reached
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ use std::sync::atomic::Ordering;
|
|||
use std::time::Duration;
|
||||
use tokio_retry::strategy::{ExponentialBackoff, FixedInterval};
|
||||
use tokio_retry::{Retry, RetryIf};
|
||||
use tracing::{event, instrument};
|
||||
use tracing::{event, info, instrument};
|
||||
|
||||
impl Client {
|
||||
#[instrument(level = "debug", skip_all)]
|
||||
|
|
@ -26,6 +26,7 @@ impl Client {
|
|||
&self,
|
||||
params: QueryCollabParams,
|
||||
) -> Result<EncodedCollab, AppResponseError> {
|
||||
info!("get collab:{}", params);
|
||||
// 2 seconds, 4 seconds, 8 seconds
|
||||
let retry_strategy = ExponentialBackoff::from_millis(2).factor(1000).take(3);
|
||||
let action = GetCollabAction::new(self.clone(), params);
|
||||
|
|
|
|||
|
|
@ -246,33 +246,6 @@ fn bulk_from_redis_value(v: &Value) -> Result<&Vec<Value>, RedisError> {
|
|||
}
|
||||
}
|
||||
|
||||
struct UserId(i64);
|
||||
|
||||
impl FromRedisValue for UserId {
|
||||
fn from_redis_value(v: &Value) -> RedisResult<Self> {
|
||||
match v {
|
||||
Value::Data(uid_bytes) => {
|
||||
if uid_bytes.len() == std::mem::size_of::<i64>() {
|
||||
let mut buf = [0u8; 8];
|
||||
buf.copy_from_slice(uid_bytes);
|
||||
let value = i64::from_be_bytes(buf);
|
||||
Ok(Self(value))
|
||||
} else {
|
||||
Err(RedisError::from((
|
||||
redis::ErrorKind::TypeError,
|
||||
"Invalid UID length",
|
||||
format!("Expected 8 bytes, got {}", uid_bytes.len()),
|
||||
)))
|
||||
}
|
||||
},
|
||||
_ => Err(RedisError::from((
|
||||
redis::ErrorKind::TypeError,
|
||||
"Expected Value::Data for UID",
|
||||
))),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)]
|
||||
pub enum CollabControlEvent {
|
||||
Open {
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ use serde::{Deserialize, Serialize};
|
|||
use serde_repr::{Deserialize_repr, Serialize_repr};
|
||||
use std::cmp::Ordering;
|
||||
use std::collections::HashMap;
|
||||
use std::fmt::Display;
|
||||
use std::ops::{Deref, DerefMut};
|
||||
use std::str::FromStr;
|
||||
use tracing::error;
|
||||
|
|
@ -159,6 +160,16 @@ pub struct QueryCollabParams {
|
|||
pub inner: QueryCollab,
|
||||
}
|
||||
|
||||
impl Display for QueryCollabParams {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
write!(
|
||||
f,
|
||||
"workspace_id: {}, object_id: {}, collab_type: {:?}",
|
||||
self.workspace_id, self.object_id, self.collab_type
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
impl QueryCollabParams {
|
||||
pub fn new<T1: ToString, T2: ToString>(
|
||||
object_id: T1,
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
FROM lukemathwalker/cargo-chef:latest-rust-1.75.0 as chef
|
||||
FROM lukemathwalker/cargo-chef:latest-rust-1.77 as chef
|
||||
|
||||
# Set the initial working directory
|
||||
WORKDIR /app
|
||||
|
|
|
|||
|
|
@ -245,6 +245,7 @@ where
|
|||
}
|
||||
|
||||
#[instrument(level = "trace", skip(self, params), oid = %params.oid, ty = %params.collab_type, err)]
|
||||
#[allow(clippy::blocks_in_conditions)]
|
||||
async fn insert_new_collab_with_transaction(
|
||||
&self,
|
||||
workspace_id: &str,
|
||||
|
|
|
|||
Loading…
Reference in New Issue