mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-08-23 00:00:33 +00:00
pg_embed
This commit is contained in:
@@ -342,6 +342,7 @@ fn print_help() {
|
||||
println!(" SERVER_BIND_ADDR = {} IP to bind the server to", DEFAULT_SERVER_BIND_ADDR);
|
||||
println!(" NUM_WORKERS = {} Number of workers (standalone/worker modes)", DEFAULT_NUM_WORKERS);
|
||||
println!(" WORKER_GROUP = default Worker group this worker belongs to",);
|
||||
println!(" QUIT_AFTER_FIRST_PING = false Exit worker after first successful ping (useful for testing)");
|
||||
println!(" JSON_FMT = false Output logs in JSON instead of logfmt");
|
||||
println!(" METRICS_ADDR = None (EE only) Prometheus metrics addr at /metrics; set \"true\" to use :8001");
|
||||
println!(" SUPERADMIN_SECRET = None Virtual superadmin token (server)");
|
||||
|
||||
@@ -316,6 +316,11 @@ lazy_static::lazy_static! {
|
||||
.and_then(|x| x.parse::<bool>().ok())
|
||||
.unwrap_or(false);
|
||||
|
||||
pub static ref QUIT_AFTER_FIRST_PING: bool = std::env::var("QUIT_AFTER_FIRST_PING")
|
||||
.ok()
|
||||
.and_then(|x| x.parse::<bool>().ok())
|
||||
.unwrap_or(false);
|
||||
|
||||
pub static ref UNSHARE_TINI_PATH: String = {
|
||||
std::env::var("UNSHARE_TINI_PATH").unwrap_or_else(|_| "tini".to_string())
|
||||
};
|
||||
@@ -1265,6 +1270,14 @@ pub async fn run_worker(
|
||||
.await
|
||||
.expect("initial ping could be sent");
|
||||
|
||||
if *QUIT_AFTER_FIRST_PING {
|
||||
tracing::info!(
|
||||
worker = %worker_name, hostname = %hostname,
|
||||
"QUIT_AFTER_FIRST_PING is set, exiting after successful initial ping"
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
#[cfg(feature = "prometheus")]
|
||||
let uptime_metric = if METRICS_ENABLED.load(Ordering::Relaxed) {
|
||||
Some(
|
||||
|
||||
Reference in New Issue
Block a user