bug fixed

This commit is contained in:
병준 박 2022-08-29 05:53:32 +00:00
parent 4c785f2542
commit f9f245f2a2

View File

@ -90,19 +90,31 @@ impl Synchronizer {
}), }),
}; };
let ss_get_member_by_username_res_msg = self let ss_get_member_by_username_res_msg = match self
.connection_broker .connection_broker
.request( .request(
bpr::ss::member::SUBJECT_GET_MEMBER_BY_USERNAME, bpr::ss::member::SUBJECT_GET_MEMBER_BY_USERNAME,
ss_get_member_by_username_req.encode_to_vec(), ss_get_member_by_username_req.encode_to_vec(),
) )
.await .await
.expect("SUBJECT_GET_MEMBER_BY_USERNAME"); {
Ok(r) => r,
Err(e) => {
println!("bpr::ss::member::SUBJECT_GET_MEMBER_BY_USERNAME: {}", e);
continue;
}
};
let ss_get_member_by_username_res = bpr::ss::member::GetMemberByUsernameResponse::decode( let ss_get_member_by_username_res =
match bpr::ss::member::GetMemberByUsernameResponse::decode(
ss_get_member_by_username_res_msg.data.as_slice(), ss_get_member_by_username_res_msg.data.as_slice(),
) ) {
.expect("GetMemberByUsernameResponse"); Ok(r) => r,
Err(e) => {
println!("bpr::ss::member::GetMemberByUsernameResponse: {}", e);
continue;
}
};
if let Some(e) = ss_get_member_by_username_res.error { if let Some(e) = ss_get_member_by_username_res.error {
println!( println!(
@ -117,16 +129,19 @@ impl Synchronizer {
Some(m) => { Some(m) => {
let member_id = uuid::Uuid::from_str(m.id.as_str()).expect("uuid::Uuid"); let member_id = uuid::Uuid::from_str(m.id.as_str()).expect("uuid::Uuid");
self match self.member_repository.insert(
.member_repository
.insert(
&conn, &conn,
&repositories::member::models::NewMember { &repositories::member::models::NewMember {
id: u.id, id: u.id,
member_id, member_id,
}, },
) ) {
.expect("member insert"); Ok(r) => r,
Err(e) => {
println!("member_repository.insert: {}", e);
continue;
}
};
} }
None => { None => {
println!("member is not exist: {}", u.site_username); println!("member is not exist: {}", u.site_username);