mirror of
https://github.com/LemmyNet/activitypub-federation-rust.git
synced 2024-06-08 16:29:33 +00:00
make work on rust < 1.70
This commit is contained in:
parent
e9f01583a4
commit
5058d1aba6
|
@ -195,8 +195,13 @@ impl<T: Clone> FederationConfig<T> {
|
|||
.activity_queue
|
||||
.take()
|
||||
.context("ActivityQueue never constructed, build() not called?")?;
|
||||
let stats = Arc::<ActivityQueue>::into_inner(q)
|
||||
.context("Could not cleanly shut down: activityqueue arc was still in use elsewhere ")?
|
||||
// Todo: use Arc::into_inner but is only part of rust 1.70.
|
||||
let stats = Arc::<ActivityQueue>::try_unwrap(q)
|
||||
.map_err(|_| {
|
||||
anyhow::anyhow!(
|
||||
"Could not cleanly shut down: activityqueue arc was still in use elsewhere "
|
||||
)
|
||||
})?
|
||||
.shutdown(wait_retries)
|
||||
.await?;
|
||||
return Ok(stats);
|
||||
|
|
Loading…
Reference in a new issue