fix write_db tokio join
This commit is contained in:
		@@ -170,8 +170,10 @@ async fn read_from_db(id: u32) -> Option<Question> {
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
async fn write_db() {
 | 
					async fn write_db() {
 | 
				
			||||||
    let (tx, rx) = mpsc::unbounded_channel::<Question>();
 | 
					    let (tx, rx) = mpsc::unbounded_channel::<Question>();
 | 
				
			||||||
    let (r, _) = tokio::join!(tokio::spawn(zip_reader_task(tx)), db_writer_task(rx),);
 | 
					    tokio::try_join!(
 | 
				
			||||||
    r.expect("tokio join");
 | 
					        tokio::spawn(zip_reader_task(tx)),
 | 
				
			||||||
 | 
					        tokio::spawn(db_writer_task(rx))
 | 
				
			||||||
 | 
					    ).expect("tokio join");
 | 
				
			||||||
    println!("all done");
 | 
					    println!("all done");
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
async fn db_writer_task(rx: UnboundedReceiver<Question>) {
 | 
					async fn db_writer_task(rx: UnboundedReceiver<Question>) {
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user