From c4331cd290dc7f5b63fd047276cd740a1e66ce9c Mon Sep 17 00:00:00 2001 From: librelois <c@elo.tf> Date: Fri, 21 May 2021 20:17:12 +0200 Subject: [PATCH] fix(indexer): get_next_wot_id must init correctly NEXT_WOT_ID static --- indexer/src/lib.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/indexer/src/lib.rs b/indexer/src/lib.rs index 87cb8c2..b7fa23a 100644 --- a/indexer/src/lib.rs +++ b/indexer/src/lib.rs @@ -80,12 +80,13 @@ fn get_next_wot_id() -> WotId { next_wot_id_.add_assign(1); next_wot_id } else { - NEXT_WOT_ID = Some(if let Some(main_wot) = MAIN_WOT.get() { + let next_wot_id = if let Some(main_wot) = MAIN_WOT.get() { main_wot.read().size() } else { 0 - }); - 0 + }; + NEXT_WOT_ID = Some(next_wot_id + 1); + next_wot_id } }) } -- GitLab