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(())
|
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();
|
ACTIVITY_CHANNEL.keepalive_sender.lock().await.take();
|
||||||
outgoing_activities_task.await??;
|
outgoing_activities_task.await?;
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -225,11 +225,12 @@ where
|
||||||
Ok(())
|
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 {
|
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(
|
pub async fn match_outgoing_activities(
|
||||||
|
|
|
@ -171,6 +171,7 @@ impl InstanceWorker {
|
||||||
.await
|
.await
|
||||||
.context("failed reading activity from db")?
|
.context("failed reading activity from db")?
|
||||||
else {
|
else {
|
||||||
|
tracing::debug!("{}: {:?} does not exist", self.instance.domain, id);
|
||||||
self.state.last_successful_id = Some(id);
|
self.state.last_successful_id = Some(id);
|
||||||
continue;
|
continue;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue