Skip to content

Commit

Permalink
feat: create socket path for dfdaemon download (#193)
Browse files Browse the repository at this point in the history
Signed-off-by: Gaius <[email protected]>
  • Loading branch information
gaius-qi authored Jan 3, 2024
1 parent 594e721 commit 962edfb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "dragonfly-client"
version = "0.1.7"
version = "0.1.8"
authors = ["The Dragonfly Developers"]
homepage = "https://d7y.io/"
repository = "https://github.com/dragonflyoss/client.git"
Expand Down
4 changes: 4 additions & 0 deletions src/grpc/dfdaemon_download.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ use dragonfly_api::scheduler::v2::StatTaskRequest as SchedulerStatTaskRequest;
use std::path::PathBuf;
use std::sync::Arc;
use std::time::Duration;
use tokio::fs;
use tokio::net::{UnixListener, UnixStream};
use tokio::sync::mpsc;
use tokio_stream::wrappers::{ReceiverStream, UnixListenerStream};
Expand Down Expand Up @@ -103,6 +104,9 @@ impl DfdaemonDownloadServer {
"download server listening on {}",
self.socket_path.display()
);
fs::create_dir_all(self.socket_path.parent().unwrap())
.await
.unwrap();
let uds = UnixListener::bind(&self.socket_path).unwrap();
let uds_stream = UnixListenerStream::new(uds);
Server::builder()
Expand Down

0 comments on commit 962edfb

Please sign in to comment.