summaryrefslogtreecommitdiff
path: root/src/io.rs
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/io.rs
parent6fa7c3f44d97b20e0614bb0c314b76e302982e6e (diff)
[api] artifacts/ now supports streaming in-progress artifacts back out as they are provided
Diffstat (limited to 'src/io.rs')
-rw-r--r--src/io.rs10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/io.rs b/src/io.rs
index 219edbf..6e71282 100644
--- a/src/io.rs
+++ b/src/io.rs
@@ -5,6 +5,14 @@ use std::io::Write;
use tokio::fs::OpenOptions;
use std::task::{Poll, Context};
use std::pin::Pin;
+use std::time::{UNIX_EPOCH, SystemTime};
+
+pub fn now_ms() -> u64 {
+ SystemTime::now()
+ .duration_since(UNIX_EPOCH)
+ .expect("now is later than epoch")
+ .as_millis() as u64
+}
pub struct ArtifactStream {
sender: hyper::body::Sender,
@@ -51,7 +59,7 @@ impl tokio::io::AsyncWrite for ArtifactStream {
pub struct ArtifactDescriptor {
job_id: u64,
- artifact_id: u64,
+ pub artifact_id: u64,
file: File,
}