Skip to content

Commit

Permalink
Merge branch 'main' into feat/postgres-trigger-captures
Browse files Browse the repository at this point in the history
  • Loading branch information
dieriba committed Feb 3, 2025
2 parents d2056ed + 0e80775 commit 2273a91
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ CaddyfileRemoteMalo
*.swp
**/.idea/
.direnv
.vscode
.vscode
17 changes: 11 additions & 6 deletions backend/windmill-api/src/users.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

use std::sync::atomic::AtomicBool;
use std::sync::Arc;
use std::time::Duration;

use crate::db::ApiAuthed;

Expand Down Expand Up @@ -464,9 +465,11 @@ async fn list_user_usage(
require_admin(authed.is_admin, &authed.username)?;
}
let mut tx = user_db.begin(&authed).await?;
let rows = sqlx::query_as!(
UserWithUsage,
"
let rows = tokio::time::timeout(
Duration::from_secs(300),
sqlx::query_as!(
UserWithUsage,
"
SELECT usr.email, usage.executions
FROM usr
, LATERAL (
Expand All @@ -479,10 +482,12 @@ async fn list_user_usage(
) usage
WHERE workspace_id = $1
",
w_id
w_id
)
.fetch_all(&mut *tx),
)
.fetch_all(&mut *tx)
.await?;
.await
.map_err(|e| Error::InternalErr(format!("Timed out while fetching user usage: {e:#}")))??;
tx.commit().await?;
Ok(Json(rows))
}
Expand Down
7 changes: 5 additions & 2 deletions backend/windmill-worker/src/global_cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ use windmill_common::error;
#[cfg(all(feature = "enterprise", feature = "parquet", unix))]
use std::sync::Arc;

#[cfg(all(feature = "enterprise", feature = "parquet"))]
pub const TARGET: &str = const_format::concatcp!(std::env::consts::OS, "_", std::env::consts::ARCH);

#[cfg(all(feature = "enterprise", feature = "parquet", unix))]
pub async fn build_tar_and_push(
s3_client: Arc<dyn ObjectStore>,
Expand Down Expand Up @@ -57,7 +60,7 @@ pub async fn build_tar_and_push(
if let Err(e) = s3_client
.put(
&Path::from(format!(
"/tar/{}/{folder_name}.tar",
"/tar/{TARGET}/{}/{folder_name}.tar",
if no_uv { "pip" } else { &python_xyz }
)),
std::fs::read(&tar_path)?.into(),
Expand Down Expand Up @@ -100,7 +103,7 @@ pub async fn pull_from_tar(
let start = Instant::now();

let tar_path = format!(
"tar/{}/{folder_name}.tar",
"tar/{TARGET}/{}/{folder_name}.tar",
if no_uv { "pip".to_owned() } else { python_xyz }
);
let bytes = attempt_fetch_bytes(client, &tar_path).await?;
Expand Down
2 changes: 1 addition & 1 deletion backend/windmill-worker/src/python_executor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,7 @@ pub async fn uv_pip_compile(
if *NATIVE_CERT {
args.extend(["--native-tls"]);
}
tracing::error!("uv args: {:?}", args);
tracing::debug!("uv args: {:?}", args);

#[cfg(windows)]
let uv_cmd = "uv";
Expand Down

0 comments on commit 2273a91

Please sign in to comment.