mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-08-22 08:02:19 +00:00
fix compile
This commit is contained in:
+10
-9
@@ -36,12 +36,13 @@ use windmill_common::{
|
||||
CRITICAL_ERROR_CHANNELS_SETTING, CUSTOM_TAGS_SETTING, DEFAULT_TAGS_PER_WORKSPACE_SETTING,
|
||||
DEFAULT_TAGS_WORKSPACES_SETTING, ENV_SETTINGS, EXPOSE_DEBUG_METRICS_SETTING,
|
||||
EXPOSE_METRICS_SETTING, EXTRA_PIP_INDEX_URL_SETTING, HUB_BASE_URL_SETTING, INDEXER_SETTING,
|
||||
INSTANCE_PYTHON_VERSION_SETTING, JOB_DEFAULT_TIMEOUT_SECS_SETTING, JWT_SECRET_SETTING, KEEP_JOB_DIR_SETTING,
|
||||
LICENSE_KEY_SETTING, MONITOR_LOGS_ON_OBJECT_STORE_SETTING, NPM_CONFIG_REGISTRY_SETTING,
|
||||
NUGET_CONFIG_SETTING, OAUTH_SETTING, OTEL_SETTING, PIP_INDEX_URL_SETTING,
|
||||
REQUEST_SIZE_LIMIT_SETTING, REQUIRE_PREEXISTING_USER_FOR_OAUTH_SETTING,
|
||||
RETENTION_PERIOD_SECS_SETTING, SAML_METADATA_SETTING, SCIM_TOKEN_SETTING, SMTP_SETTING,
|
||||
TIMEOUT_WAIT_RESULT_SETTING, TEAMS_SETTING
|
||||
INSTANCE_PYTHON_VERSION_SETTING, JOB_DEFAULT_TIMEOUT_SECS_SETTING, JWT_SECRET_SETTING,
|
||||
KEEP_JOB_DIR_SETTING, LICENSE_KEY_SETTING, MONITOR_LOGS_ON_OBJECT_STORE_SETTING,
|
||||
NPM_CONFIG_REGISTRY_SETTING, NUGET_CONFIG_SETTING, OAUTH_SETTING, OTEL_SETTING,
|
||||
PIP_INDEX_URL_SETTING, REQUEST_SIZE_LIMIT_SETTING,
|
||||
REQUIRE_PREEXISTING_USER_FOR_OAUTH_SETTING, RETENTION_PERIOD_SECS_SETTING,
|
||||
SAML_METADATA_SETTING, SCIM_TOKEN_SETTING, SMTP_SETTING, TEAMS_SETTING,
|
||||
TIMEOUT_WAIT_RESULT_SETTING,
|
||||
},
|
||||
scripts::ScriptLang,
|
||||
stats_ee::schedule_stats,
|
||||
@@ -788,7 +789,7 @@ Windmill Community Edition {GIT_VERSION}
|
||||
EXPOSE_METRICS_SETTING => {
|
||||
tracing::info!("Metrics setting changed, restarting");
|
||||
// we wait a bit randomly to avoid having all servers and workers shutdown at same time
|
||||
let rd_delay = rand::thread_rng().gen_range(0..40);
|
||||
let rd_delay = rand::rng().gen_range(0..40);
|
||||
tokio::time::sleep(Duration::from_secs(rd_delay)).await;
|
||||
if let Err(e) = tx.send(()) {
|
||||
tracing::error!(error = %e, "Could not send killpill to server");
|
||||
@@ -802,7 +803,7 @@ Windmill Community Edition {GIT_VERSION}
|
||||
OTEL_SETTING => {
|
||||
tracing::info!("OTEL setting changed, restarting");
|
||||
// we wait a bit randomly to avoid having all servers and workers shutdown at same time
|
||||
let rd_delay = rand::thread_rng().gen_range(0..4);
|
||||
let rd_delay = rand::rng().gen_range(0..4);
|
||||
tokio::time::sleep(Duration::from_secs(rd_delay)).await;
|
||||
if let Err(e) = tx.send(()) {
|
||||
tracing::error!(error = %e, "Could not send killpill");
|
||||
@@ -812,7 +813,7 @@ Windmill Community Edition {GIT_VERSION}
|
||||
if server_mode {
|
||||
tracing::info!("Request limit size change detected, killing server expecting to be restarted");
|
||||
// we wait a bit randomly to avoid having all servers shutdown at same time
|
||||
let rd_delay = rand::thread_rng().gen_range(0..4);
|
||||
let rd_delay = rand::rng().gen_range(0..4);
|
||||
tokio::time::sleep(Duration::from_secs(rd_delay)).await;
|
||||
if let Err(e) = tx.send(()) {
|
||||
tracing::error!(error = %e, "Could not send killpill to server");
|
||||
|
||||
@@ -283,7 +283,7 @@ pub async fn create_postgres_trigger(
|
||||
if create_publication || create_slot {
|
||||
let generate_random_string = move || {
|
||||
let timestamp = Utc::now().timestamp_millis().to_string();
|
||||
let mut rng = rand::thread_rng();
|
||||
let mut rng = rand::rng();
|
||||
let charset = "abcdefghijklmnopqrstuvwxyz0123456789";
|
||||
|
||||
let random_part = (0..10)
|
||||
|
||||
@@ -76,7 +76,7 @@ impl PostgresSimpleClient {
|
||||
.port(database.port)
|
||||
.user(&database.user)
|
||||
.replication_mode(rust_postgres::config::ReplicationMode::Logical);
|
||||
|
||||
|
||||
if !database.password.is_empty() {
|
||||
config.password(&database.password);
|
||||
}
|
||||
@@ -490,7 +490,7 @@ async fn listen_to_unlistened_database_events(
|
||||
|
||||
match postgres_triggers {
|
||||
Ok(mut triggers) => {
|
||||
triggers.shuffle(&mut rand::thread_rng());
|
||||
triggers.shuffle(&mut rand::rng());
|
||||
for trigger in triggers {
|
||||
try_to_listen_to_database_transactions(
|
||||
trigger,
|
||||
|
||||
@@ -390,7 +390,7 @@ async fn listen_to_unlistened_websockets(
|
||||
.await
|
||||
{
|
||||
Ok(mut triggers) => {
|
||||
triggers.shuffle(&mut rand::thread_rng());
|
||||
triggers.shuffle(&mut rand::rng());
|
||||
for trigger in triggers {
|
||||
trigger.maybe_listen_to_websocket(db.clone(), killpill_rx.resubscribe()).await;
|
||||
}
|
||||
@@ -408,7 +408,7 @@ async fn listen_to_unlistened_websockets(
|
||||
.await
|
||||
{
|
||||
Ok(mut captures) => {
|
||||
captures.shuffle(&mut rand::thread_rng());
|
||||
captures.shuffle(&mut rand::rng());
|
||||
for capture in captures {
|
||||
capture.maybe_listen_to_websocket(db.clone(), killpill_rx.resubscribe()).await;
|
||||
}
|
||||
|
||||
@@ -161,8 +161,8 @@ impl Retry {
|
||||
if let Some(random_factor) = exponential.random_factor {
|
||||
if random_factor > 0 {
|
||||
let random_component =
|
||||
rand::thread_rng().gen_range(0..(std::cmp::min(random_factor, 100) as u16));
|
||||
secs = match rand::thread_rng().gen_bool(1.0 / 2.0) {
|
||||
rand::rng().random_range(0..(std::cmp::min(random_factor, 100) as u16));
|
||||
secs = match rand::rng().random_bool(1.0 / 2.0) {
|
||||
true => secs.saturating_add(secs * random_component / 100),
|
||||
false => secs.saturating_sub(secs * random_component / 100),
|
||||
};
|
||||
|
||||
@@ -19,7 +19,8 @@ use git_version::git_version;
|
||||
|
||||
use chrono::Utc;
|
||||
use croner::Cron;
|
||||
use rand::{distributions::Alphanumeric, thread_rng, Rng};
|
||||
use rand::distr::Alphanumeric;
|
||||
use rand::{rng, Rng};
|
||||
use reqwest::Client;
|
||||
use semver::Version;
|
||||
use serde::{Deserialize, Serialize};
|
||||
@@ -205,7 +206,7 @@ pub async fn http_get_from_hub(
|
||||
}
|
||||
|
||||
pub fn rd_string(len: usize) -> String {
|
||||
thread_rng()
|
||||
rng()
|
||||
.sample_iter(&Alphanumeric)
|
||||
.take(len)
|
||||
.map(char::from)
|
||||
|
||||
@@ -1095,7 +1095,7 @@ pub async fn run_worker(
|
||||
#[cfg(feature = "benchmark")]
|
||||
let mut infos = BenchmarkInfo::new();
|
||||
|
||||
let vacuum_shift = rand::thread_rng().gen_range(0..VACUUM_PERIOD);
|
||||
let vacuum_shift = rand::rng().random_range(0..VACUUM_PERIOD);
|
||||
|
||||
IS_READY.store(true, Ordering::Relaxed);
|
||||
tracing::info!(
|
||||
|
||||
Reference in New Issue
Block a user