File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1919
2020
2121_ARGS = parse_command_line_arguments ()
22- _HUB = Hub (_ARGS .name )
22+ _HUB = Hub (_ARGS .name , _ARGS . share_timeout_secs )
2323_APP = fastapi .FastAPI ()
2424
2525
Original file line number Diff line number Diff line change @@ -26,12 +26,14 @@ class Hub:
2626 """
2727
2828 _name : str
29+ _share_timeout_secs : int
2930 _peer_clients : dict [str , PeerClient ] # Indexed by client name
3031 _shares : dict [UUID , Share ] # Indexed by key UUID
3132 _stop_task : asyncio .Task | None
3233
33- def __init__ (self , name : str ):
34+ def __init__ (self , name : str , share_timeout_secs : int ):
3435 self ._name = name
36+ self ._share_timeout_secs = share_timeout_secs
3537 self ._peer_clients = {}
3638 self ._shares = {}
3739 self ._stop_task = None
@@ -49,6 +51,7 @@ def to_mgmt(self):
4951 """
5052 return {
5153 "name" : self ._name ,
54+ "share_timeout_secs" : self ._share_timeout_secs ,
5255 "peer_clients" : [
5356 peer_client .to_mgmt () for peer_client in self ._peer_clients .values ()
5457 ],
You can’t perform that action at this time.
0 commit comments