gatherer/main: reuse PERIODS and TREND_POOL_SIZE

This commit is contained in:
Astro 2022-11-16 03:12:00 +01:00
parent 8e3f9b9734
commit 2709c192fe
2 changed files with 3 additions and 3 deletions

View File

@ -8,7 +8,7 @@ use crate::{feed::Post, trend_tag::TrendTag, PERIOD_COMPARE_WINDOW, current_hour
const POST_EXPIRE: usize = 86400;
const TAG_EXPIRE: u64 = 30 * 24;
pub const TREND_POOL_SIZE: usize = 30;
pub const TREND_POOL_SIZE: usize = 20;
pub type Error = RedisError;

View File

@ -1,6 +1,6 @@
use cave::{
config::LoadConfig,
store::Store,
store::{Store, TREND_POOL_SIZE}, PERIODS,
};
use crate::{
firehose::FirehoseFactory,
@ -28,7 +28,7 @@ impl Muxable for RequestFactory {
async fn request(&self, language: Self::Key) -> Self::Result {
let mut store = self.store.clone();
let results = trends::TrendAnalyzer::run(&mut store, 20, &[4, 24, 24 * 7], language)
let results = trends::TrendAnalyzer::run(&mut store, TREND_POOL_SIZE, PERIODS, language)
.await.unwrap();
let mut languages = store.get_languages().await.unwrap();
languages.sort();