Skip to content

Commit

Permalink
feat(core): update indexer
Browse files Browse the repository at this point in the history
  • Loading branch information
remiroyc committed Sep 7, 2023
1 parent a3eaa45 commit 3ef2671
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions crates/ark-db/src/indexer/update.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()));

Check warning on line 36 in crates/ark-db/src/indexer/update.rs

View workflow job for this annotation

GitHub Actions / clippy

called `unwrap` on `from` after checking its variant with `is_some`

warning: called `unwrap` on `from` after checking its variant with `is_some` --> crates/ark-db/src/indexer/update.rs:36:58 | 35 | if from.is_some() { | ----------------- help: try: `if let Some(..) = from` 36 | request = request.item("from", AttributeValue::N(from.unwrap().to_string())); | ^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap = note: `#[warn(clippy::unnecessary_unwrap)]` on by default
Expand Down

0 comments on commit 3ef2671

Please sign in to comment.