remove crashable, comment

This commit is contained in:
phiresky 2024-05-30 13:18:36 +02:00
parent 175133f0cd
commit 2acdc78d81
2 changed files with 8 additions and 8 deletions

View file

@ -92,6 +92,10 @@ impl CommunityInboxCollector {
.send_inboxes
.iter()
.filter_map(std::option::Option::as_ref)
// a similar filter also happens within the activitypub-federation crate. but that filter
// happens much later - by doing it here, we can ensure that in the happy case, this
// function returns 0 urls which means the system doesn't have to create a tokio
// task for sending at all (since that task has a fair amount of overhead)
.filter(|&u| (u.domain() == Some(&self.domain)))
.map(|u| u.inner().clone()),
);

View file

@ -8,9 +8,7 @@ use crate::{
WORK_FINISHED_RECHECK_DELAY,
},
};
use activitypub_federation::{
config::{FederationConfig},
};
use activitypub_federation::config::FederationConfig;
use anyhow::{Context, Result};
use chrono::{DateTime, Days, TimeZone, Utc};
use lemmy_api_common::{
@ -119,11 +117,9 @@ impl InstanceWorker {
let next_id_to_send = ActivityId(last_sent_id.0 + 1);
{
// sanity check: calculate next id to send based on the last id and the in flight requests
let last_successful_id = self
.state
.last_successful_id
.map(|e| e.0)
.expect("set above");
let last_successful_id = self.state.last_successful_id.map(|e| e.0).context(
"impossible: id is initialized in get_latest_ids and never returned to None",
)?;
let expected_next_id = last_successful_id + (successfuls.len() as i64) + in_flight + 1;
// compare to next id based on incrementing
if expected_next_id != next_id_to_send.0 {