mirror of
https://github.com/LemmyNet/lemmy
synced 2024-10-30 15:21:20 +00:00
make activity channel infallible (#4295)
This commit is contained in:
parent
dcb89f52d6
commit
6790b54d4d
@ -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 New Issue
Block a user