Skip to content

Commit

Permalink
skip migration env, ee fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
alpetric committed Sep 27, 2024
1 parent fb81321 commit 951bd8e
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
12 changes: 10 additions & 2 deletions backend/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -373,8 +373,16 @@ async fn windmill_main() -> anyhow::Result<()> {
let is_agent = mode == Mode::Agent;

if !is_agent {
// migration code to avoid break
windmill_api::migrate_db(&db).await?;
let skip_migration = std::env::var("SKIP_MIGRATION")
.map(|val| val == "true")
.unwrap_or(false);

if !skip_migration {
// migration code to avoid break
windmill_api::migrate_db(&db).await?;
} else {
tracing::info!("SKIP_MIGRATION set, skipping db migration...")
}
}

let (killpill_tx, mut killpill_rx) = tokio::sync::broadcast::channel::<()>(2);
Expand Down
3 changes: 3 additions & 0 deletions backend/windmill-common/src/worker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -449,10 +449,13 @@ pub async fn save_cache(
fn write_binary_file(main_path: &str, byts: &mut bytes::Bytes) -> error::Result<()> {
use std::fs::{File, Permissions};
use std::io::Write;

#[cfg(unix)]
use std::os::unix::fs::PermissionsExt;

let mut file = File::create(main_path)?;
file.write_all(byts)?;
#[cfg(unix)]
file.set_permissions(Permissions::from_mode(0o755))?;
file.flush()?;
Ok(())
Expand Down
2 changes: 2 additions & 0 deletions backend/windmill-worker/src/bun_executor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -557,6 +557,7 @@ pub async fn pull_codebase(w_id: &str, id: &str, job_dir: &str) -> Result<()> {
if is_tar {
extract_tar(fs::read(bun_cache_path)?.into(), job_dir).await?;
} else {
#[cfg(unix)]
tokio::fs::symlink(&bun_cache_path, dst).await?;
}
} else if let Some(os) = windmill_common::s3_helpers::OBJECT_STORE_CACHE_SETTINGS
Expand All @@ -570,6 +571,7 @@ pub async fn pull_codebase(w_id: &str, id: &str, job_dir: &str) -> Result<()> {
if is_tar {
extract_tar(bytes, job_dir).await?;
} else {
#[cfg(unix)]
tokio::fs::symlink(bun_cache_path, dst).await?;
}

Expand Down

0 comments on commit 951bd8e

Please sign in to comment.