summaryrefslogtreecommitdiff
path: root/src/lua
diff options
context:
space:
mode:
authoriximeow <me@iximeow.net>2023-06-27 01:47:29 -0700
committeriximeow <me@iximeow.net>2023-06-27 01:47:29 -0700
commit55ed9f337ae0cf8e1336448d6b4273b3ee31aca2 (patch)
treee53faad5b4b4c9c03985078bcfac6a9ffcca4e21 /src/lua
parent6fa7c3f44d97b20e0614bb0c314b76e302982e6e (diff)
[api] artifacts/ now supports streaming in-progress artifacts back out as they are provided
Diffstat (limited to 'src/lua')
-rw-r--r--src/lua/mod.rs11
1 files changed, 1 insertions, 10 deletions
diff --git a/src/lua/mod.rs b/src/lua/mod.rs
index 662b34c..53473cf 100644
--- a/src/lua/mod.rs
+++ b/src/lua/mod.rs
@@ -4,7 +4,6 @@ use rlua::prelude::*;
use std::sync::{Arc, Mutex};
use std::path::PathBuf;
-use std::time::{UNIX_EPOCH, SystemTime};
pub const DEFAULT_RUST_GOODFILE: &'static [u8] = include_bytes!("../../config/goodfiles/rust.lua");
@@ -18,7 +17,6 @@ mod lua_exports {
use std::sync::{Arc, Mutex};
use std::path::PathBuf;
- use std::time::{UNIX_EPOCH, SystemTime};
use rlua::prelude::*;
@@ -166,13 +164,6 @@ mod lua_exports {
})
}
- pub fn now_ms() -> u64 {
- SystemTime::now()
- .duration_since(UNIX_EPOCH)
- .expect("now is later than epoch")
- .as_millis() as u64
- }
-
pub fn has_cmd(name: &str) -> Result<bool, rlua::Error> {
Ok(std::process::Command::new("which")
.arg(name)
@@ -239,7 +230,7 @@ impl BuildEnv {
lua_exports::metric(name, value, job_ref)
})?;
- let now_ms = decl_env.create_function("now_ms", move |_, job_ref, ()| Ok(lua_exports::now_ms()))?;
+ let now_ms = decl_env.create_function("now_ms", move |_, job_ref, ()| Ok(crate::io::now_ms()))?;
let artifact = decl_env.create_function("artifact", move |_, job_ref, (path, name): (String, Option<String>)| {
lua_exports::artifact(path, name, job_ref)