+ // could do `ACTIVITY_CHANNEL.keepalive_sender.lock()` instead and get rid of weak_sender,
+ // not sure which way is more efficient
+ else if let Some(sender) = ACTIVITY_CHANNEL.weak_sender.upgrade() {
+ sender.send(data)?;
+ }
+ Ok(())
+ }
+
+ pub async fn close(outgoing_activities_task: JoinHandle<LemmyResult<()>>) -> LemmyResult<()> {
+ ACTIVITY_CHANNEL.keepalive_sender.lock().await.take();
+ outgoing_activities_task.await??;