Skip to content
This repository was archived by the owner on Mar 29, 2024. It is now read-only.

Commit 1de860d

Browse files
authored
fix(lease): should not panic on keep_alive (#85)
1 parent d9e45d7 commit 1de860d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/lease/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ use async_trait::async_trait;
1818
use tokio::sync::mpsc::Sender;
1919
use tonic::Streaming;
2020

21-
use crate::Result;
21+
use crate::{Error, Result};
2222

2323
pub type LeaseId = i64;
2424

@@ -69,7 +69,7 @@ impl LeaseKeepAlive {
6969
self.req_tx
7070
.send(req.into())
7171
.await
72-
.expect("emit keep alive request to channel");
72+
.map_err(|_| Error::ChannelClosed)?;
7373

7474
Ok(match self.resp_rx.message().await? {
7575
Some(resp) => Some(resp.into()),

0 commit comments

Comments
 (0)