Skip to content

Commit c3ed76d

Browse files
ShyunnYeaufavor
authored andcommitted
fix: use consistent type aliase Pools
Includes-commit: 256a939 Replicated-from: #484 Signed-off-by: shyunny <[email protected]>
1 parent 6925467 commit c3ed76d

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

.bleep

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
188ce944ca056fb11402b8bc41fedfad7505cbb9
1+
98d239a60a476873e1de444763a555802aa41f6c

pingora-runtime/src/lib.rs

+4-3
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ pub struct NoStealRuntime {
111111
name: String,
112112
// Lazily init the runtimes so that they are created after pingora
113113
// daemonize itself. Otherwise the runtime threads are lost.
114-
pools: Arc<OnceCell<Box<[Handle]>>>,
114+
pools: Pools,
115115
controls: OnceCell<Vec<Control>>,
116116
}
117117

@@ -209,8 +209,8 @@ impl NoStealRuntime {
209209
#[test]
210210
fn test_steal_runtime() {
211211
use tokio::time::{sleep, Duration};
212-
213-
let rt = Runtime::new_steal(2, "test");
212+
let threads = 2;
213+
let rt = Runtime::new_steal(threads, "test");
214214
let handle = rt.get_handle();
215215
let ret = handle.block_on(async {
216216
sleep(Duration::from_secs(1)).await;
@@ -222,6 +222,7 @@ fn test_steal_runtime() {
222222
1
223223
});
224224

225+
assert_eq!(handle.metrics().num_workers(), threads);
225226
assert_eq!(ret, 1);
226227
}
227228

0 commit comments

Comments
 (0)