Skip to content
This repository has been archived by the owner on Jul 13, 2023. It is now read-only.

Commit

Permalink
feat: port migrate user to Rust, remove Python calling
Browse files Browse the repository at this point in the history
Closes #1206
  • Loading branch information
bbangert committed May 16, 2018
1 parent 733bd46 commit 9ae1fb5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
6 changes: 3 additions & 3 deletions autopush_rs/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,7 @@ where

#[state_machine_future(transitions(DetermineAck))]
AwaitMigrateUser {
response: MyFuture<String>,
response: MyFuture<()>,
data: AuthClientData<T>,
},

Expand Down Expand Up @@ -947,11 +947,11 @@ where
await_migrate_user: &'a mut RentToOwn<'a, AwaitMigrateUser<T>>,
) -> Poll<AfterAwaitMigrateUser<T>, Error> {
debug!("State: AwaitMigrateUser");
let message_month = try_ready!(await_migrate_user.response.poll());
try_ready!(await_migrate_user.response.poll());
let AwaitMigrateUser { data, .. } = await_migrate_user.take();
{
let mut webpush = data.webpush.borrow_mut();
webpush.message_month = message_month;
webpush.message_month = data.srv.opts.current_message_month.clone();
webpush.flags.rotate_message_table = false;
}
transition!(DetermineAck { data })
Expand Down
5 changes: 2 additions & 3 deletions autopush_rs/src/util/ddb_helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1005,15 +1005,14 @@ impl DynamoStorage {
message_month: &str,
current_message_month: &str,
router_table_name: &str,
) -> MyFuture<String> {
) -> MyFuture<()> {
let ddb = self.ddb.clone();
let ddb1 = self.ddb.clone();
let ddb2 = self.ddb.clone();
let uaid = uaid.clone();
let cur_month = current_message_month.to_string();
let cur_month1 = cur_month.clone();
let cur_month2 = cur_month.clone();
let cur_month3 = cur_month.clone();
let router_table_name = router_table_name.to_string();
let response = DynamoStorage::all_channels(ddb, &uaid, message_month)
.and_then(move |channels| -> MyFuture<_> {
Expand All @@ -1031,7 +1030,7 @@ impl DynamoStorage {
&cur_month2,
)
})
.and_then(move |_| -> MyFuture<_> { Box::new(future::ok(cur_month3)) })
.and_then(move |_| -> MyFuture<_> { Box::new(future::ok(())) })
.chain_err(|| "Unable to migrate user");
Box::new(response)
}
Expand Down

0 comments on commit 9ae1fb5

Please sign in to comment.