-
Notifications
You must be signed in to change notification settings - Fork 29
feat: port migrate user to Rust, remove Python calling #1237
Conversation
autopush_rs/src/util/ddb_helpers.rs
Outdated
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(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes I hate all these clones, the joy of static closures.
Codecov Report
@@ Coverage Diff @@
## master #1237 +/- ##
=======================================
Coverage 100% 100%
=======================================
Files 60 60
Lines 10211 10328 +117
=======================================
+ Hits 10211 10328 +117
Continue to review full report at Codecov.
|
let response = data.srv.ddb.migrate_user( | ||
&webpush.uaid, | ||
&webpush.message_month, | ||
&data.srv.opts.current_message_month, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so opts.current_message_month is essentially hardcoded at startup in autopush_rs.
ddb.migrate_user doesn't need to return it, then. await_migrate_user can assign webpush.message_month = data.srv.opts.current_message_month.clone();
instead
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's true.
@@ -223,6 +223,10 @@ pub extern "C" fn autopush_server_new( | |||
.expect("poll interval cannot be 0"), | |||
}; | |||
opts.message_table_names.sort_unstable(); | |||
opts.current_message_month = opts.message_table_names |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a number of the db methods do this same call to get current_message_month. we can improve that later though since they're getting refactored
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, and they do weird things since its not 'for-sure' that there's a last() on the vec, while now its guaranteed there'll be a current month.
Closes #1206