From 2709c192fe3867afed4af96ef341cafc2659a3af Mon Sep 17 00:00:00 2001 From: Astro Date: Wed, 16 Nov 2022 03:12:00 +0100 Subject: [PATCH] gatherer/main: reuse PERIODS and TREND_POOL_SIZE --- cave/src/store.rs | 2 +- gatherer/src/main.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cave/src/store.rs b/cave/src/store.rs index 01f2233..be34e33 100644 --- a/cave/src/store.rs +++ b/cave/src/store.rs @@ -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; diff --git a/gatherer/src/main.rs b/gatherer/src/main.rs index 7418367..e981c34 100644 --- a/gatherer/src/main.rs +++ b/gatherer/src/main.rs @@ -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();