node: Add timeouts to daemon connection

This commit is contained in:
Alexis Sellier 2023-06-16 09:42:34 +02:00
parent cb576cf8c3
commit 765823c686
No known key found for this signature in database
1 changed files with 3 additions and 0 deletions

View File

@ -339,6 +339,9 @@ impl Worker {
.map_err(UploadError::DaemonConnectionFailed)?;
let (mut daemon_r, mut daemon_w) = (daemon.try_clone()?, daemon);
daemon_r.set_read_timeout(Some(self.timeout))?;
daemon_w.set_write_timeout(Some(self.timeout))?;
// Write the raw request to the daemon, once we've parsed it.
daemon_w.write_all(&request)?;