fix(core): Fix async panic on blocking #19

Replaced internal threads with tokio spawn functions
This commit is contained in:
2023-02-20 10:10:42 +01:00
committed by Kasper Juul Hermansen
parent 45d6462037
commit 75bc17e57d
21 changed files with 66 additions and 61 deletions

View File

@@ -13,9 +13,9 @@ use crate::querybuilder::query;
pub type DaggerConn = Arc<Query>;
pub fn connect() -> eyre::Result<DaggerConn> {
pub async fn connect() -> eyre::Result<DaggerConn> {
let cfg = Config::default();
let (conn, proc) = DaggerEngine::new().start(&cfg)?;
let (conn, proc) = DaggerEngine::new().start(&cfg).await?;
Ok(Arc::new(Query {
conn,
@@ -44,8 +44,8 @@ pub fn graphql_client(conn: &ConnectParams) -> gql_client::Client {
mod test {
use super::connect;
#[test]
fn test_connect() {
let _ = connect().unwrap();
#[tokio::test]
async fn test_connect() {
let _ = connect().await.unwrap();
}
}

View File

@@ -22,8 +22,8 @@ pub struct SecretId(String);
pub struct SocketId(String);
#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)]
pub struct BuildArg {
pub name: String,
pub value: String,
pub name: String,
}
pub struct CacheVolume {
pub proc: Arc<Child>,