Skip to content

Commit

Permalink
expose quorum tick ms
Browse files Browse the repository at this point in the history
  • Loading branch information
Jackmin801 committed Jan 8, 2025
1 parent a41eb1c commit 13e72f1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -230,8 +230,10 @@ impl Lighthouse {
bind: String,
min_replicas: u64,
join_timeout_ms: Option<u64>,
quorum_tick_ms: Option<u64>,
) -> PyResult<Self> {
let join_timeout_ms = join_timeout_ms.unwrap_or(100);
let quorum_tick_ms = quorum_tick_ms.unwrap_or(100);

py.allow_threads(move || {
let rt = Runtime::new()?;
Expand All @@ -241,7 +243,7 @@ impl Lighthouse {
bind: bind,
min_replicas: min_replicas,
join_timeout_ms: join_timeout_ms,
quorum_tick_ms: 100,
quorum_tick_ms: quorum_tick_ms,
}))
.map_err(|e| PyRuntimeError::new_err(e.to_string()))?;

Expand Down
2 changes: 1 addition & 1 deletion torchft/torchft.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ class Manager:
def shutdown(self) -> None: ...

class Lighthouse:
def __init__(self, bind: str, min_replicas: int, join_timeout_ms: Optional[int] = None) -> None: ...
def __init__(self, bind: str, min_replicas: int, join_timeout_ms: Optional[int] = None, quorum_tick_ms: Optional[int] = None) -> None: ...
def address(self) -> str: ...
def shutdown(self) -> None: ...

0 comments on commit 13e72f1

Please sign in to comment.