Skip to content

Commit

Permalink
refactor: cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
chesedo committed Nov 7, 2022
1 parent 70815d6 commit 531cb1c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions deployer/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ async fn main() {
.spawn()
.unwrap();

// Sleep because the timeout below does not seem to work
tokio::time::sleep(Duration::from_secs(2)).await;

info!("connecting runtime client");
let conn = Endpoint::new("http://127.0.0.1:6001")
.unwrap()
Expand Down
4 changes: 3 additions & 1 deletion runtime/src/legacy/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ impl Runtime for Legacy {
let mut factory = abstract_factory.get_factory(service_name);

let logs_tx = self.logs_tx.lock().unwrap().clone();
let logger = Logger::new(logs_tx, Uuid::from_slice(&request.deployment_id).unwrap());
let deployment_id = Uuid::from_slice(&request.deployment_id).unwrap();
let logger = Logger::new(logs_tx, deployment_id);

let so_path = self
.so_path
Expand Down Expand Up @@ -127,6 +128,7 @@ impl Runtime for Legacy {
if let Some(mut logs_rx) = logs_rx {
let (tx, rx) = mpsc::channel(1);

// Move logger items into stream to be returned
tokio::spawn(async move {
while let Some(log) = logs_rx.recv().await {
tx.send(Ok(log.into())).await.unwrap();
Expand Down

0 comments on commit 531cb1c

Please sign in to comment.