Skip to content

Commit

Permalink
cargo fix --lib -p scraper
Browse files Browse the repository at this point in the history
  • Loading branch information
nikmctrl committed Apr 12, 2024
1 parent 4b4cfa6 commit c3096aa
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/db/models.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ impl Serialize for Stream {
}

mod tests {
use chrono::NaiveDateTime;


use crate::db::models::Stream;



#[test]
Expand Down
10 changes: 4 additions & 6 deletions src/scrape.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,15 @@

use std::{
borrow::BorrowMut,
collections::{vec_deque, VecDeque},
iter,
sync::{Arc, Mutex, RwLock, RwLockWriteGuard},
sync::{Arc, Mutex},
thread,
};

use anyhow::anyhow;
use db::{models, schema};
use diesel::{ExpressionMethods, RunQueryDsl, SqliteConnection};
use headless_chrome::{Browser, Tab};
use indicatif::{MultiProgress, ProgressBar, ProgressIterator, ProgressStyle};
use indicatif::{MultiProgress, ProgressBar, ProgressStyle};

use crate::{
constants::sports::{self, Sport},
Expand Down Expand Up @@ -238,11 +236,11 @@ pub fn check_all_links(browser: &Browser, conn: &mut SqliteConnection, tabs_coun
// we split the streams into chunks and create a thread for each chunk
let chunked_streams: Vec<&[models::Stream]> = all_streams.chunks(all_streams.len() / tabs_count).collect();

let length = all_streams.len();
let _length = all_streams.len();

let mut tabs: Vec<Arc<Tab>> = vec![];
let mut threads = vec![];
let completed_mutex = Arc::new(Mutex::new(0));
let _completed_mutex = Arc::new(Mutex::new(0));

let time_start = std::time::Instant::now();

Expand Down

0 comments on commit c3096aa

Please sign in to comment.