Skip to content

Commit

Permalink
Delete local object on fetch when receiving HTTP 410, split fetcher (f…
Browse files Browse the repository at this point in the history
…ixes #1256)
  • Loading branch information
Nutomic committed Jan 9, 2021
1 parent 7a97fc3 commit 9ddb5e5
Show file tree
Hide file tree
Showing 23 changed files with 786 additions and 549 deletions.
12 changes: 1 addition & 11 deletions docker/federation/start-local-instances.bash
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,4 @@ for Item in alpha beta gamma delta epsilon ; do
sudo chown -R 991:991 volumes/pictrs_$Item
done

sudo docker-compose up -d

echo "Waiting for Lemmy to start..."
while [[ "$(curl -s -o /dev/null -w '%{http_code}' 'localhost:8541/api/v1/site')" != "200" ]]; do sleep 1; done
while [[ "$(curl -s -o /dev/null -w '%{http_code}' 'localhost:8551/api/v1/site')" != "200" ]]; do sleep 1; done
while [[ "$(curl -s -o /dev/null -w '%{http_code}' 'localhost:8561/api/v1/site')" != "200" ]]; do sleep 1; done
while [[ "$(curl -s -o /dev/null -w '%{http_code}' 'localhost:8571/api/v1/site')" != "200" ]]; do sleep 1; done
while [[ "$(curl -s -o /dev/null -w '%{http_code}' 'localhost:8581/api/v1/site')" != "200" ]]; do sleep 1; done
echo "All instances started."

sudo docker-compose logs -f
sudo docker-compose up
2 changes: 1 addition & 1 deletion lemmy_api/src/site.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use crate::{
};
use actix_web::web::Data;
use anyhow::Context;
use lemmy_apub::fetcher::search_by_apub_id;
use lemmy_apub::fetcher::search::search_by_apub_id;
use lemmy_db_queries::{
diesel_option_overwrite,
source::{category::Category_, site::Site_},
Expand Down
2 changes: 1 addition & 1 deletion lemmy_apub/src/activities/receive/mod.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::fetcher::get_or_fetch_and_upsert_user;
use crate::fetcher::user::get_or_fetch_and_upsert_user;
use activitystreams::{
activity::{ActorAndObjectRef, ActorAndObjectRefExt},
base::{AsBase, BaseExt},
Expand Down
2 changes: 1 addition & 1 deletion lemmy_apub/src/activities/receive/private_message.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::{
activities::receive::verify_activity_domains_valid,
check_is_apub_id_valid,
fetcher::get_or_fetch_and_upsert_user,
fetcher::user::get_or_fetch_and_upsert_user,
inbox::get_activity_to_and_cc,
objects::FromApub,
NoteExt,
Expand Down
2 changes: 1 addition & 1 deletion lemmy_apub/src/activities/send/comment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use crate::{
activities::send::generate_activity_id,
activity_queue::{send_comment_mentions, send_to_community},
extensions::context::lemmy_context,
fetcher::get_or_fetch_and_upsert_user,
fetcher::user::get_or_fetch_and_upsert_user,
objects::ToApub,
ActorType,
ApubLikeableType,
Expand Down
2 changes: 1 addition & 1 deletion lemmy_apub/src/activities/send/community.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use crate::{
activity_queue::{send_activity_single_dest, send_to_community_followers},
check_is_apub_id_valid,
extensions::context::lemmy_context,
fetcher::get_or_fetch_and_upsert_user,
fetcher::user::get_or_fetch_and_upsert_user,
ActorType,
};
use activitystreams::{
Expand Down
Loading

0 comments on commit 9ddb5e5

Please sign in to comment.