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