mirror of
https://github.com/catdevnull/preciazo.git
synced 2024-11-22 14:16:19 +00:00
warcificator : conseguir threads de env
This commit is contained in:
parent
abd430421c
commit
2d2912e4e9
1 changed files with 5 additions and 2 deletions
|
@ -10,7 +10,7 @@ use tl::VDom;
|
||||||
// use scraper::{Element, Html, Selector};
|
// use scraper::{Element, Html, Selector};
|
||||||
use std::{
|
use std::{
|
||||||
borrow::Cow,
|
borrow::Cow,
|
||||||
env::args,
|
env::{self, args},
|
||||||
fs,
|
fs,
|
||||||
ops::Deref,
|
ops::Deref,
|
||||||
time::{SystemTime, UNIX_EPOCH},
|
time::{SystemTime, UNIX_EPOCH},
|
||||||
|
@ -150,7 +150,10 @@ async fn main() {
|
||||||
let (res_sender, res_receiver) = async_channel::unbounded::<PrecioPoint>();
|
let (res_sender, res_receiver) = async_channel::unbounded::<PrecioPoint>();
|
||||||
|
|
||||||
let mut handles = Vec::new();
|
let mut handles = Vec::new();
|
||||||
for _ in 1..32 {
|
for _ in 1..env::var("N_COROUTINES")
|
||||||
|
.map_or(Ok(32), |s| s.parse::<usize>())
|
||||||
|
.unwrap()
|
||||||
|
{
|
||||||
let rx = receiver.clone();
|
let rx = receiver.clone();
|
||||||
let tx = res_sender.clone();
|
let tx = res_sender.clone();
|
||||||
handles.push(tokio::spawn(worker(rx, tx)));
|
handles.push(tokio::spawn(worker(rx, tx)));
|
||||||
|
|
Loading…
Reference in a new issue