Spawn cache tasks for new follows

This commit is contained in:
asonix 2021-02-10 12:35:37 -06:00
parent 52408d8189
commit 1c813d917b
3 changed files with 10 additions and 3 deletions

2
Cargo.lock generated
View file

@ -1933,7 +1933,7 @@ checksum = "b5eb417147ba9860a96cfe72a0b93bf88fee1744b5636ec99ab20c1aa9376581"
[[package]]
name = "relay"
version = "0.2.4"
version = "0.2.5"
dependencies = [
"activitystreams",
"activitystreams-ext",

View file

@ -1,7 +1,7 @@
[package]
name = "relay"
description = "A simple activitypub relay"
version = "0.2.4"
version = "0.2.5"
authors = ["asonix <asonix@asonix.dog>"]
license-file = "LICENSE"
readme = "README.md"

View file

@ -3,7 +3,7 @@ use crate::{
config::{Config, UrlKind},
db::Actor,
error::MyError,
jobs::{apub::prepare_activity, Deliver, JobState},
jobs::{apub::prepare_activity, Deliver, JobState, QueryInstance, QueryNodeinfo},
};
use activitystreams::{
activity::{Accept as AsAccept, Follow as AsFollow},
@ -49,6 +49,13 @@ impl Follow {
state
.job_server
.queue(Deliver::new(self.actor.inbox, accept)?)?;
state
.job_server
.queue(QueryInstance::new(self.actor.id.clone()))?;
state.job_server.queue(QueryNodeinfo::new(self.actor.id))?;
Ok(())
}
}