From c4d8c0354136994dd71987bcae30ccbd193445c6 Mon Sep 17 00:00:00 2001 From: PARK BYUNG JUN Date: Mon, 29 Aug 2022 03:02:37 +0000 Subject: [PATCH] checking for id duplication is added --- src/synchronizations/game/synchronizer.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/synchronizations/game/synchronizer.rs b/src/synchronizations/game/synchronizer.rs index 0ae9bc1..63beac1 100644 --- a/src/synchronizations/game/synchronizer.rs +++ b/src/synchronizations/game/synchronizer.rs @@ -80,6 +80,14 @@ impl Synchronizer { let res = self.game_api.list_games(req).await?; for g in res.games { + match upsert_games.iter().find(|v| v.id.eq(&g.id)) { + Some(d) => { + println!("id is duplicated. e: {:?}, n: {:?}", d, g); + continue; + } + None => {} + }; + upsert_games.push(repositories::game::models::UpsertGame { id: g.id, vendor_id: v.id,