mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-08-22 16:02:24 +00:00
add logs around connecting to database
This commit is contained in:
@@ -86,7 +86,9 @@ async fn main() -> anyhow::Result<()> {
|
||||
config
|
||||
});
|
||||
|
||||
tracing::info!("Connecting to database...");
|
||||
let db = windmill_common::connect_db(server_mode).await?;
|
||||
tracing::info!("Database connected");
|
||||
|
||||
let rsmq = if let Some(config) = rsmq_config {
|
||||
let mut rsmq = rsmq_async::MultiplexedRsmq::new(config).await.unwrap();
|
||||
|
||||
@@ -1891,6 +1891,31 @@ async fn leave_workspace(
|
||||
Ok(format!("left workspace {w_id}"))
|
||||
}
|
||||
|
||||
#[derive(Serialize)]
|
||||
struct Runnable {
|
||||
workspace: String,
|
||||
endpoint: String,
|
||||
summary: String,
|
||||
description: String,
|
||||
schema: Option<serde_json::Value>,
|
||||
}
|
||||
|
||||
async fn get_all_runnables(
|
||||
Extension(db): Extension<UserDB>,
|
||||
authed: Authed,
|
||||
) -> JsonResult<Vec<Runnable>> {
|
||||
let mut tx = db.begin(&authed).await?;
|
||||
let mut runnables = Vec::new();
|
||||
// sqlx::query!(
|
||||
// "SELECT * FROM usr WHERE workspace_id = $1 AND username = $2",
|
||||
// username
|
||||
// )
|
||||
// .execute(&mut tx)
|
||||
// .await?;
|
||||
|
||||
Ok(Json(runnables))
|
||||
}
|
||||
|
||||
pub async fn delete_expired_items_perdiodically(
|
||||
db: &DB,
|
||||
mut rx: tokio::sync::broadcast::Receiver<()>,
|
||||
|
||||
Reference in New Issue
Block a user