chore (backend-rs): don't iterate the same process
This commit is contained in:
parent
797c768f24
commit
c73ce2ff39
1 changed files with 6 additions and 6 deletions
|
@ -176,6 +176,12 @@ pub async fn send_push_notification(
|
|||
};
|
||||
tracing::trace!("payload: {:#?}", payload);
|
||||
|
||||
let encoding = if kind == PushNotificationKind::Mastodon {
|
||||
ContentEncoding::AesGcm
|
||||
} else {
|
||||
ContentEncoding::Aes128Gcm
|
||||
};
|
||||
|
||||
for subscription in subscriptions.iter() {
|
||||
if !subscription.send_read_message
|
||||
&& [
|
||||
|
@ -218,12 +224,6 @@ pub async fn send_push_notification(
|
|||
continue;
|
||||
}
|
||||
|
||||
let encoding = if kind == PushNotificationKind::Mastodon {
|
||||
ContentEncoding::AesGcm
|
||||
} else {
|
||||
ContentEncoding::Aes128Gcm
|
||||
};
|
||||
|
||||
let mut message_builder = WebPushMessageBuilder::new(&subscription_info);
|
||||
message_builder.set_ttl(1000);
|
||||
message_builder.set_payload(encoding, payload.as_bytes());
|
||||
|
|
Loading…
Reference in a new issue