Put activities generated by CLI commands in a queue
This commit is contained in:
parent
49f51f44d8
commit
0f3c247069
3 changed files with 8 additions and 4 deletions
|
@ -13,6 +13,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
||||||
- Added `federation` parameter group to configuration.
|
- Added `federation` parameter group to configuration.
|
||||||
- Add empty `spoiler_text` property to Mastodon API Status object.
|
- Add empty `spoiler_text` property to Mastodon API Status object.
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- Put activities generated by CLI commands in a queue instead of immediately sending them.
|
||||||
|
|
||||||
### Deprecated
|
### Deprecated
|
||||||
|
|
||||||
- Deprecated `proxy_url` configuration parameter (replaced by `federation.proxy_url`).
|
- Deprecated `proxy_url` configuration parameter (replaced by `federation.proxy_url`).
|
||||||
|
|
|
@ -244,7 +244,7 @@ impl DeleteProfile {
|
||||||
deletion_queue.process(config).await;
|
deletion_queue.process(config).await;
|
||||||
// Send Delete(Person) activities
|
// Send Delete(Person) activities
|
||||||
if let Some(activity) = maybe_delete_person {
|
if let Some(activity) = maybe_delete_person {
|
||||||
activity.deliver().await?;
|
activity.enqueue(db_client).await?;
|
||||||
};
|
};
|
||||||
println!("profile deleted");
|
println!("profile deleted");
|
||||||
Ok(())
|
Ok(())
|
||||||
|
@ -279,7 +279,7 @@ impl DeletePost {
|
||||||
deletion_queue.process(config).await;
|
deletion_queue.process(config).await;
|
||||||
// Send Delete(Note) activity
|
// Send Delete(Note) activity
|
||||||
if let Some(activity) = maybe_delete_note {
|
if let Some(activity) = maybe_delete_note {
|
||||||
activity.deliver().await?;
|
activity.enqueue(db_client).await?;
|
||||||
};
|
};
|
||||||
println!("post deleted");
|
println!("post deleted");
|
||||||
Ok(())
|
Ok(())
|
||||||
|
|
|
@ -252,7 +252,7 @@ impl OutgoingActivity {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub async fn deliver(
|
pub(super) async fn deliver(
|
||||||
self,
|
self,
|
||||||
) -> Result<(), DelivererError> {
|
) -> Result<(), DelivererError> {
|
||||||
deliver_activity_worker(
|
deliver_activity_worker(
|
||||||
|
@ -264,7 +264,7 @@ impl OutgoingActivity {
|
||||||
).await
|
).await
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn spawn_deliver(self) -> () {
|
pub(super) fn spawn_deliver(self) -> () {
|
||||||
tokio::spawn(async move {
|
tokio::spawn(async move {
|
||||||
self.deliver().await.unwrap_or_else(|err| {
|
self.deliver().await.unwrap_or_else(|err| {
|
||||||
log::error!("{}", err);
|
log::error!("{}", err);
|
||||||
|
|
Loading…
Reference in a new issue