From 3ef267146feb4284ec1aa75883dcea7357b576f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Roycourt?= Date: Thu, 7 Sep 2023 09:59:19 +0200 Subject: [PATCH] feat(core): update indexer --- crates/ark-db/src/indexer/update.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/crates/ark-db/src/indexer/update.rs b/crates/ark-db/src/indexer/update.rs index 6b9a76111..d69b36346 100644 --- a/crates/ark-db/src/indexer/update.rs +++ b/crates/ark-db/src/indexer/update.rs @@ -22,13 +22,15 @@ pub async fn update_indexer( let mut request = dynamo_client .put_item() .table_name(indexer_table_name) + .item("PK", AttributeValue::S(String::from("Indexer"))) .item( - "PK", - AttributeValue::S(format!("Indexer_{}", task_id.to_string())), + "SK", + AttributeValue::S(format!("{}_{}", indexer_version, task_id.to_string())), ) - .item("SK", AttributeValue::S(String::from(indexer_version))) .item("status", AttributeValue::S(status)) - .item("last_update", AttributeValue::N(unix_timestamp.to_string())); + .item("last_update", AttributeValue::N(unix_timestamp.to_string())) + .item("version", AttributeValue::S(indexer_version)) + .item("indexer", AttributeValue::S(task_id.to_string())); if from.is_some() { request = request.item("from", AttributeValue::N(from.unwrap().to_string()));