mirror of
https://github.com/meilisearch/meilisearch.git
synced 2024-11-30 00:55:00 +08:00
fix the timing issue
This commit is contained in:
parent
7934e3956b
commit
ba69ad672a
@ -214,13 +214,12 @@ impl Segment {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async fn run(mut self, meilisearch: MeiliSearch) {
|
async fn run(mut self, meilisearch: MeiliSearch) {
|
||||||
println!("CALLED");
|
|
||||||
const INTERVAL: Duration = Duration::from_secs(60 * 60); // one hour
|
const INTERVAL: Duration = Duration::from_secs(60 * 60); // one hour
|
||||||
loop {
|
|
||||||
let mut interval = tokio::time::interval(INTERVAL);
|
let mut interval = tokio::time::interval(INTERVAL);
|
||||||
|
|
||||||
|
loop {
|
||||||
select! {
|
select! {
|
||||||
_ = interval.tick() => {
|
_ = interval.tick() => {
|
||||||
println!("TRIGGERED");
|
|
||||||
self.tick(meilisearch.clone()).await;
|
self.tick(meilisearch.clone()).await;
|
||||||
},
|
},
|
||||||
msg = self.inbox.recv() => {
|
msg = self.inbox.recv() => {
|
||||||
@ -238,7 +237,6 @@ impl Segment {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async fn tick(&mut self, meilisearch: MeiliSearch) {
|
async fn tick(&mut self, meilisearch: MeiliSearch) {
|
||||||
println!("SENDING A TICK");
|
|
||||||
if let Ok(stats) = meilisearch.get_all_stats().await {
|
if let Ok(stats) = meilisearch.get_all_stats().await {
|
||||||
let _ = self
|
let _ = self
|
||||||
.batcher
|
.batcher
|
||||||
|
Loading…
Reference in New Issue
Block a user