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]] [[package]]
name = "relay" name = "relay"
version = "0.2.4" version = "0.2.5"
dependencies = [ dependencies = [
"activitystreams", "activitystreams",
"activitystreams-ext", "activitystreams-ext",

View file

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

View file

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