mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-29 21:57:55 +00:00
be more careful about fusing in select! (#2052)
This commit is contained in:
committed by
GitHub
parent
b13052de12
commit
709f990fb2
@@ -84,8 +84,9 @@ impl CollationGenerationSubsystem {
|
||||
// at any point waiting for them all, so instead, we create a channel on which they can
|
||||
// send those messages. We can then just monitor the channel and forward messages on it
|
||||
// to the overseer here, via the context.
|
||||
let (sender, mut receiver) = mpsc::channel(0);
|
||||
let (sender, receiver) = mpsc::channel(0);
|
||||
|
||||
let mut receiver = receiver.fuse();
|
||||
loop {
|
||||
select! {
|
||||
incoming = ctx.recv().fuse() => {
|
||||
@@ -93,7 +94,7 @@ impl CollationGenerationSubsystem {
|
||||
break;
|
||||
}
|
||||
},
|
||||
msg = receiver.next().fuse() => {
|
||||
msg = receiver.next() => {
|
||||
if let Some(msg) = msg {
|
||||
ctx.send_message(msg).await;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user