Write activity ID to log if repost already exists in database
This commit is contained in:
parent
c4ad98126a
commit
bf92cebe5c
1 changed files with 5 additions and 2 deletions
|
@ -66,13 +66,16 @@ pub async fn handle_announce(
|
||||||
post.id
|
post.id
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
let repost_data = PostCreateData::repost(post_id, Some(repost_object_id));
|
let repost_data = PostCreateData::repost(
|
||||||
|
post_id,
|
||||||
|
Some(repost_object_id.clone()),
|
||||||
|
);
|
||||||
match create_post(db_client, &author.id, repost_data).await {
|
match create_post(db_client, &author.id, repost_data).await {
|
||||||
Ok(_) => Ok(Some(NOTE)),
|
Ok(_) => Ok(Some(NOTE)),
|
||||||
Err(DatabaseError::AlreadyExists("post")) => {
|
Err(DatabaseError::AlreadyExists("post")) => {
|
||||||
// Ignore activity if repost already exists (with a different
|
// Ignore activity if repost already exists (with a different
|
||||||
// object ID, or due to race condition in a handler).
|
// object ID, or due to race condition in a handler).
|
||||||
log::warn!("repost already exists");
|
log::warn!("repost already exists: {}", repost_object_id);
|
||||||
Ok(None)
|
Ok(None)
|
||||||
},
|
},
|
||||||
Err(other_error) => Err(other_error.into()),
|
Err(other_error) => Err(other_error.into()),
|
||||||
|
|
Loading…
Reference in a new issue