mirror of
https://git.asonix.dog/asonix/relay.git
synced 2024-11-14 13:41:01 +00:00
Spawn cache tasks for new follows
This commit is contained in:
parent
52408d8189
commit
1c813d917b
3 changed files with 10 additions and 3 deletions
2
Cargo.lock
generated
2
Cargo.lock
generated
|
@ -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",
|
||||||
|
|
|
@ -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"
|
||||||
|
|
|
@ -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(())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue