From: Geoffrey Allott Date: Sat, 27 Feb 2021 13:41:49 +0000 (+0000) Subject: log error on failed summary lookup, keep other games unchanged X-Git-Url: https://git.pointlesshacks.com/?a=commitdiff_plain;h=2937f49a0cc3fa9e16ebb06d921acf333351c269;p=pokerwave.git log error on failed summary lookup, keep other games unchanged --- diff --git a/src/server.rs b/src/server.rs index 42bb1fa..455c98b 100644 --- a/src/server.rs +++ b/src/server.rs @@ -163,9 +163,12 @@ impl ServerState { pub async fn game_list(&mut self, from: usize) -> RedisResult> { debug!("game_list(from: {})", from); let games: Vec = self.redis.lrange("game:list", from as isize, -1).await?; - let mut summaries = Vec::new(); + let mut summaries = Vec::with_capacity(games.len()); for id in games { - summaries.push(self.game_summary(id).await?); + match self.game_summary(id).await { + Ok(summary) => summaries.push(summary), + Err(err) => error!("Could not find summary for game {}", id), + } } Ok(summaries) }