From 2bafa7cec0c58caa5d95b0bc6cb1e7a18ecaf4ef Mon Sep 17 00:00:00 2001 From: Brandon Thomas Date: Mon, 1 Jun 2020 02:19:06 -0400 Subject: [PATCH] sort sentences desc, increase limit to 1000 --- deployment.yaml | 2 +- tts_service/src/database/model.rs | 1 + tts_service/src/endpoints/sentences.rs | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/deployment.yaml b/deployment.yaml index 349e89aec2..6c6e9f5b36 100644 --- a/deployment.yaml +++ b/deployment.yaml @@ -84,7 +84,7 @@ spec: # LSpeech model that sounds 100% amazing # image: docker.pkg.github.com/echelon/voder/tts-service:6b5c22567614 # - image: docker.pkg.github.com/ml-applications/voder/tts-service:d83cd11aaf1f + image: docker.pkg.github.com/ml-applications/voder/tts-service:a671a66b3903 resources: limits: memory: "2048Mi" # 2048 MiB = 2 GiB diff --git a/tts_service/src/database/model.rs b/tts_service/src/database/model.rs index def1690840..941f4567c1 100644 --- a/tts_service/src/database/model.rs +++ b/tts_service/src/database/model.rs @@ -39,6 +39,7 @@ impl Sentence { let pooled_connection : MysqlPooledConnection = db_connector.get_pooled_connection()?; let results = sentences::dsl::sentences .limit(limit) + .order(sentences::dsl::id.desc()) .load::(&pooled_connection)?; Ok(results) } diff --git a/tts_service/src/endpoints/sentences.rs b/tts_service/src/endpoints/sentences.rs index 981f2489ee..b6765bc7c9 100644 --- a/tts_service/src/endpoints/sentences.rs +++ b/tts_service/src/endpoints/sentences.rs @@ -21,7 +21,7 @@ pub async fn get_sentences( ) -> Either, std::io::Result>{ let app_state = app_state.into_inner(); - let limit = 100; + let limit = 1000; let sentences = match Sentence::load(&app_state.database_connector, limit) { Err(e) => { error!("Couldn't query database for sentences: {:?}", e);