mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-11-22 09:21:01 +00:00
make activity channel infallible (#4295)
This commit is contained in:
parent
dcb89f52d6
commit
6790b54d4d
3 changed files with 7 additions and 5 deletions
|
@ -98,9 +98,9 @@ impl ActivityChannel {
|
|||
Ok(())
|
||||
}
|
||||
|
||||
pub async fn close(outgoing_activities_task: JoinHandle<LemmyResult<()>>) -> LemmyResult<()> {
|
||||
pub async fn close(outgoing_activities_task: JoinHandle<()>) -> LemmyResult<()> {
|
||||
ACTIVITY_CHANNEL.keepalive_sender.lock().await.take();
|
||||
outgoing_activities_task.await??;
|
||||
outgoing_activities_task.await?;
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
|
|
@ -225,11 +225,12 @@ where
|
|||
Ok(())
|
||||
}
|
||||
|
||||
pub async fn handle_outgoing_activities(context: Data<LemmyContext>) -> LemmyResult<()> {
|
||||
pub async fn handle_outgoing_activities(context: Data<LemmyContext>) {
|
||||
while let Some(data) = ActivityChannel::retrieve_activity().await {
|
||||
match_outgoing_activities(data, &context.reset_request_count()).await?
|
||||
if let Err(e) = match_outgoing_activities(data, &context.reset_request_count()).await {
|
||||
tracing::warn!("error while saving outgoing activity to db: {e}");
|
||||
}
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub async fn match_outgoing_activities(
|
||||
|
|
|
@ -171,6 +171,7 @@ impl InstanceWorker {
|
|||
.await
|
||||
.context("failed reading activity from db")?
|
||||
else {
|
||||
tracing::debug!("{}: {:?} does not exist", self.instance.domain, id);
|
||||
self.state.last_successful_id = Some(id);
|
||||
continue;
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue