Skip to content

Commit

Permalink
Add default timeout value
Browse files Browse the repository at this point in the history
  • Loading branch information
YuanTingHsieh committed Apr 2, 2024
1 parent b092551 commit 7e45e33
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion nvflare/fuel/utils/pipe/file_pipe.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
from nvflare.fuel.utils.pipe.file_accessor import FileAccessor
from nvflare.fuel.utils.pipe.file_name_utils import file_name_to_message, message_to_file_name
from nvflare.fuel.utils.pipe.fobs_file_accessor import FobsFileAccessor
from nvflare.fuel.utils.pipe.pipe import Message, Pipe
from nvflare.fuel.utils.pipe.pipe import Message, Pipe, Topic
from nvflare.fuel.utils.validation_utils import check_object_type, check_positive_number, check_str


Expand Down Expand Up @@ -260,6 +260,10 @@ def send(self, msg: Message, timeout=None) -> bool:
"""
if not self.pipe_path:
raise BrokenPipeError("pipe is not open")

if not timeout and msg.topic in [Topic.END, Topic.ABORT, Topic.HEARTBEAT]:
timeout = 5.0

return self.put_f(msg, timeout)

def receive(self, timeout=None):
Expand Down

0 comments on commit 7e45e33

Please sign in to comment.