mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-09-10 16:05:58 +00:00
test logs
This commit is contained in:
+5
-4
@@ -473,9 +473,9 @@ async fn windmill_main() -> anyhow::Result<()> {
|
||||
} else {
|
||||
// This time we use a pool of connections
|
||||
let db = windmill_common::connect_db(server_mode, indexer_mode, worker_mode).await?;
|
||||
|
||||
|
||||
// NOTE: Variable/resource cache initialization moved to API server in windmill-api
|
||||
|
||||
|
||||
Connection::Sql(db)
|
||||
};
|
||||
|
||||
@@ -725,6 +725,7 @@ Windmill Community Edition {GIT_VERSION}
|
||||
server_mode,
|
||||
mcp_mode,
|
||||
base_internal_url.clone(),
|
||||
None,
|
||||
)
|
||||
.await?;
|
||||
}
|
||||
@@ -938,7 +939,7 @@ Windmill Community Edition {GIT_VERSION}
|
||||
},
|
||||
"var_cache_invalidation" => {
|
||||
if let Ok(payload) = serde_json::from_str::<serde_json::Value>(n.payload()) {
|
||||
if let (Some(workspace_id), Some(path)) =
|
||||
if let (Some(workspace_id), Some(path)) =
|
||||
(payload.get("workspace_id").and_then(|v| v.as_str()),
|
||||
payload.get("path").and_then(|v| v.as_str())) {
|
||||
tracing::info!("Variable cache invalidation detected: {}:{}", workspace_id, path);
|
||||
@@ -948,7 +949,7 @@ Windmill Community Edition {GIT_VERSION}
|
||||
},
|
||||
"resource_cache_invalidation" => {
|
||||
if let Ok(payload) = serde_json::from_str::<serde_json::Value>(n.payload()) {
|
||||
if let (Some(workspace_id), Some(path)) =
|
||||
if let (Some(workspace_id), Some(path)) =
|
||||
(payload.get("workspace_id").and_then(|v| v.as_str()),
|
||||
payload.get("path").and_then(|v| v.as_str())) {
|
||||
tracing::info!("Resource cache invalidation detected: {}:{}", workspace_id, path);
|
||||
|
||||
@@ -136,7 +136,8 @@ impl ApiServer {
|
||||
let addr = sock.local_addr().unwrap();
|
||||
drop(sock);
|
||||
let (port_tx, _port_rx) = tokio::sync::oneshot::channel::<String>();
|
||||
|
||||
let name = next_worker_name();
|
||||
tracing::info!("starting api server for name={name}");
|
||||
let task = tokio::task::spawn(windmill_api::run_server(
|
||||
db.clone(),
|
||||
None,
|
||||
@@ -147,9 +148,13 @@ impl ApiServer {
|
||||
false,
|
||||
false,
|
||||
format!("http://localhost:{}", addr.port()),
|
||||
Some(name.clone()),
|
||||
));
|
||||
|
||||
_port_rx.await.expect("failed to receive port");
|
||||
tracing::info!("waiting for server port for name={name}");
|
||||
_port_rx
|
||||
.await
|
||||
.expect(format!("failed to receive port for name={name}").as_str());
|
||||
|
||||
// clear the cache between tests
|
||||
windmill_common::cache::clear();
|
||||
|
||||
@@ -280,6 +280,7 @@ pub async fn run_server(
|
||||
server_mode: bool,
|
||||
mcp_mode: bool,
|
||||
_base_internal_url: String,
|
||||
name: Option<String>,
|
||||
) -> anyhow::Result<()> {
|
||||
let user_db = UserDB::new(db.clone());
|
||||
|
||||
@@ -300,7 +301,6 @@ pub async fn run_server(
|
||||
));
|
||||
let argon2 = Arc::new(Argon2::default());
|
||||
|
||||
|
||||
let disable_response_logs = std::env::var("DISABLE_RESPONSE_LOGS")
|
||||
.ok()
|
||||
.map(|x| x == "true")
|
||||
@@ -728,13 +728,17 @@ pub async fn run_server(
|
||||
)
|
||||
};
|
||||
|
||||
if let Some(name) = name.as_ref() {
|
||||
tracing::info!("server starting for name={name}");
|
||||
}
|
||||
let server = axum::serve(listener, app.into_make_service());
|
||||
|
||||
tracing::info!(
|
||||
instance = %*INSTANCE_NAME,
|
||||
"server started on port={} and addr={}",
|
||||
"server started on port={} and addr={} {}",
|
||||
port,
|
||||
ip
|
||||
ip,
|
||||
name.map(|x| format!("name={x}")).unwrap_or_default()
|
||||
);
|
||||
|
||||
port_tx
|
||||
|
||||
Reference in New Issue
Block a user