Skip to content

Commit

Permalink
bug: Remove download server UDS file on client startup if UDS file al…
Browse files Browse the repository at this point in the history
…ready exists...
  • Loading branch information
e-ngo committed Jan 23, 2025
1 parent d4096db commit 0c2c652
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions dragonfly-client/src/grpc/dfdaemon_download.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,11 @@ impl DfdaemonDownloadServer {

// Start download grpc server with unix domain socket.
fs::create_dir_all(self.socket_path.parent().unwrap()).await?;

if self.socket_path.is_file() {
// Remove the old unix domain socket file if it exists.
fs::remove_file(&self.socket_path).await?;
}
let uds = UnixListener::bind(&self.socket_path)?;
let uds_stream = UnixListenerStream::new(uds);

Expand Down

0 comments on commit 0c2c652

Please sign in to comment.