summaryrefslogtreecommitdiff
path: root/src/lua
diff options
context:
space:
mode:
Diffstat (limited to 'src/lua')
-rw-r--r--src/lua/mod.rs10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/lua/mod.rs b/src/lua/mod.rs
index 936c94a..26d2d5b 100644
--- a/src/lua/mod.rs
+++ b/src/lua/mod.rs
@@ -162,11 +162,15 @@ impl BuildEnv {
.build()
.unwrap();
rt.block_on(async move {
- let artifact = job_ref.lock().unwrap().create_artifact(&name, &format!("{} (from {})", name, path.display())).await
+ let mut artifact = job_ref.lock().unwrap().create_artifact(&name, &format!("{} (from {})", name, path.display())).await
.map_err(|e| LuaError::RuntimeError(format!("create_artifact error: {:?}", e)))
.unwrap();
- crate::forward_data(tokio::fs::File::open(&format!("tmpdir/{}", path.display())).await.unwrap(), artifact).await
- .map_err(|e| LuaError::RuntimeError(format!("failed uploading data for {}: {:?}", name, e)))
+ let mut file = tokio::fs::File::open(&format!("tmpdir/{}", path.display())).await.unwrap();
+ eprintln!("uploading...");
+ crate::io::forward_data(&mut file, &mut artifact).await
+ .map_err(|e| LuaError::RuntimeError(format!("failed uploading data for {}: {:?}", name, e)))?;
+ std::mem::drop(artifact);
+ Ok(())
})
})
.map_err(|e| format!("problem defining metric function: {:?}", e))?;