mirror of
https://github.com/kjuulh/dagger-rs.git
synced 2025-07-26 03:19:21 +02:00
fix(core): Fix async panic on blocking #19
Replaced internal threads with tokio spawn functions
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
@@ -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>,
|
||||
|
Reference in New Issue
Block a user