add logs around connecting to database

This commit is contained in:
Ruben Fiszel
2023-05-25 17:45:17 +02:00
parent e38510c6ef
commit c8ff19befd
2 changed files with 27 additions and 0 deletions
+2
View File
@@ -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();
+25
View File
@@ -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<()>,