mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-10-13 00:03:00 +00:00
feat: start new instances on python 3.15
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
9daee20959
commit
7399b7e8a6
@@ -14,6 +14,7 @@ use tokio::{fs::DirBuilder, process::Command, sync::RwLock};
|
||||
use uuid::Uuid;
|
||||
use windmill_common::{
|
||||
error::{self, Error},
|
||||
global_settings::{load_value_from_global_settings, INSTANCE_PYTHON_VERSION_SETTING},
|
||||
worker::{try_parse_locked_python_version_from_requirements, Connection, PyVAlias},
|
||||
};
|
||||
|
||||
@@ -256,7 +257,23 @@ impl PyV {
|
||||
conn: Option<Connection>,
|
||||
) -> Self {
|
||||
let mut err = None;
|
||||
let pyv = match INSTANCE_PYTHON_VERSION.read().await.clone() {
|
||||
let mut setting = INSTANCE_PYTHON_VERSION.read().await.clone();
|
||||
// A worker that loaded its settings while the server was still initializing the instance
|
||||
// read no version, and may have started listening for setting changes only after it was
|
||||
// written. Jobs only exist once it is, so reading it here settles that worker for good.
|
||||
if setting.is_none() {
|
||||
if let Some(Connection::Sql(db)) = conn.as_ref() {
|
||||
setting = load_value_from_global_settings(db, INSTANCE_PYTHON_VERSION_SETTING)
|
||||
.await
|
||||
.ok()
|
||||
.flatten()
|
||||
.and_then(|v| serde_json::from_value::<String>(v).ok());
|
||||
if setting.is_some() {
|
||||
*INSTANCE_PYTHON_VERSION.write().await = setting.clone();
|
||||
}
|
||||
}
|
||||
}
|
||||
let pyv = match setting {
|
||||
Some(v) if &v == "default" => PyVAlias::default().into(),
|
||||
Some(v) => pep440_rs::Version::from_str(&v).unwrap_or_else(|_| {
|
||||
let v = PyVAlias::default().into();
|
||||
|
||||
Reference in New Issue
Block a user