File tree Expand file tree Collapse file tree 2 files changed +4
-7
lines changed Expand file tree Collapse file tree 2 files changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -10,11 +10,10 @@ use octocrab::models::events::payload::EventPayload::{
1010use  rust_decimal:: Decimal ; 
1111use  rust_decimal:: prelude:: * ; 
1212use  std:: env; 
13- use  std:: fs:: File ; 
1413use  std:: io:: { BufRead ,  BufReader } ; 
1514use  std:: path:: PathBuf ; 
16- use  std:: sync:: Arc ; 
1715use  tokio:: fs; 
16+ use  tokio:: fs:: File ; 
1817use  tokio:: process:: Command ; 
1918use  tokio:: task:: JoinSet ; 
2019
@@ -38,8 +37,6 @@ pub async fn start_channel() -> Result<()> {
3837
3938    init_pg ( ) . await ?; 
4039
41-     let  rx = Arc :: new ( rx) ; 
42- 
4340    let  mut  consumers = JoinSet :: new ( ) ; 
4441
4542    for  _ in  0 ..max_concurrent { 
@@ -151,7 +148,7 @@ async fn try_open_file(file_path: &PathBuf) -> Option<File> {
151148        . unwrap_or ( 3 ) ; 
152149
153150    for  i in  0 ..max_retries { 
154-         if  let  Ok ( file)  = File :: open ( file_path)  { 
151+         if  let  Ok ( file)  = File :: open ( file_path) . await  { 
155152            return  Some ( file) ; 
156153        } 
157154
@@ -177,7 +174,7 @@ async fn try_open_file(file_path: &PathBuf) -> Option<File> {
177174#[ tracing:: instrument]  
178175async  fn  load_gh_event ( file_path :  PathBuf )  -> Vec < EventTableStruct >  { 
179176    let  file = match  try_open_file ( & file_path) . await  { 
180-         Some ( file)  => file, 
177+         Some ( file)  => file. into_std ( ) . await , 
181178        None  => return  vec ! [ ] , 
182179    } ; 
183180    let  decoder = GzDecoder :: new ( file) ; 
Original file line number Diff line number Diff line change 11mod  channel; 
22mod  db; 
33
4+ use  crate :: channel:: start_channel; 
45use  anyhow:: Result ; 
56use  dotenvy:: dotenv; 
67use  std:: time:: Instant ; 
@@ -11,7 +12,6 @@ use tracing_subscriber::{
1112    layer:: SubscriberExt , 
1213    util:: SubscriberInitExt , 
1314} ; 
14- use  crate :: channel:: start_channel; 
1515
1616#[ tokio:: main]  
1717async  fn  main ( )  -> Result < ( ) >  { 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments