Changeset View
Changeset View
Standalone View
Standalone View
services/identity/src/database.rs
Show First 20 Lines • Show All 466 Lines • ▼ Show 20 Lines | let partition_key = | ||||
create_one_time_key_partition_key(device_id, account_type); | create_one_time_key_partition_key(device_id, account_type); | ||||
self | self | ||||
.client | .client | ||||
.query() | .query() | ||||
.table_name(NAME) | .table_name(NAME) | ||||
.key_condition_expression(format!("{} = :pk", PARTITION_KEY)) | .key_condition_expression(format!("{} = :pk", PARTITION_KEY)) | ||||
.expression_attribute_values(":pk", AttributeValue::S(partition_key)) | .expression_attribute_values(":pk", AttributeValue::S(partition_key)) | ||||
.return_consumed_capacity( | |||||
aws_sdk_dynamodb::model::ReturnConsumedCapacity::Total, | |||||
) | |||||
.send() | .send() | ||||
.await | .await | ||||
.map_err(|e| Error::AwsSdk(e.into())) | .map_err(|e| Error::AwsSdk(e.into())) | ||||
.map(|response| { | |||||
let capacity_units = response | |||||
.consumed_capacity() | |||||
.and_then(|it| it.capacity_units()); | |||||
debug!("OTK read consumed capacity: {:?}", capacity_units); | |||||
response | |||||
}) | |||||
} | } | ||||
pub async fn set_prekey( | pub async fn set_prekey( | ||||
&self, | &self, | ||||
user_id: String, | user_id: String, | ||||
device_id: String, | device_id: String, | ||||
content_prekey: String, | content_prekey: String, | ||||
content_prekey_signature: String, | content_prekey_signature: String, | ||||
▲ Show 20 Lines • Show All 992 Lines • Show Last 20 Lines |