diff options
author | iximeow <me@iximeow.net> | 2023-06-27 01:47:29 -0700 |
---|---|---|
committer | iximeow <me@iximeow.net> | 2023-06-27 01:47:29 -0700 |
commit | 55ed9f337ae0cf8e1336448d6b4273b3ee31aca2 (patch) | |
tree | e53faad5b4b4c9c03985078bcfac6a9ffcca4e21 /src/io.rs | |
parent | 6fa7c3f44d97b20e0614bb0c314b76e302982e6e (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.rs | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -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, } |