mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2025-09-11 00:52:49 +02:00
run cargo fix for rust 2024 changes and rustfmt
Signed-off-by: June Clementine Strawberry <strawberry@puppygock.gay>
This commit is contained in:
parent
e97952b7f6
commit
a1e1f40ded
320 changed files with 2212 additions and 2039 deletions
|
@ -1,10 +1,10 @@
|
|||
use std::{fmt::Debug, mem};
|
||||
|
||||
use bytes::BytesMut;
|
||||
use conduwuit::{debug_error, err, trace, utils, warn, Err, Result};
|
||||
use conduwuit::{Err, Result, debug_error, err, trace, utils, warn};
|
||||
use reqwest::Client;
|
||||
use ruma::api::{
|
||||
appservice::Registration, IncomingResponse, MatrixVersion, OutgoingRequest, SendAccessToken,
|
||||
IncomingResponse, MatrixVersion, OutgoingRequest, SendAccessToken, appservice::Registration,
|
||||
};
|
||||
|
||||
/// Sends a request to an appservice
|
||||
|
|
|
@ -1,16 +1,15 @@
|
|||
use std::{fmt::Debug, sync::Arc};
|
||||
|
||||
use conduwuit::{
|
||||
at, utils,
|
||||
utils::{stream::TryIgnore, ReadyExt},
|
||||
Error, Result,
|
||||
Error, Result, at, utils,
|
||||
utils::{ReadyExt, stream::TryIgnore},
|
||||
};
|
||||
use database::{Database, Deserialized, Map};
|
||||
use futures::{Stream, StreamExt};
|
||||
use ruma::{OwnedServerName, ServerName, UserId};
|
||||
|
||||
use super::{Destination, SendingEvent};
|
||||
use crate::{globals, Dep};
|
||||
use crate::{Dep, globals};
|
||||
|
||||
pub(super) type OutgoingItem = (Key, SendingEvent, Destination);
|
||||
pub(super) type SendingItem = (Key, SendingEvent);
|
||||
|
@ -102,7 +101,7 @@ impl Data {
|
|||
pub fn active_requests_for(
|
||||
&self,
|
||||
destination: &Destination,
|
||||
) -> impl Stream<Item = SendingItem> + Send + '_ {
|
||||
) -> impl Stream<Item = SendingItem> + Send + '_ + use<'_> {
|
||||
let prefix = destination.get_prefix();
|
||||
self.servercurrentevent_data
|
||||
.raw_stream_from(&prefix)
|
||||
|
@ -156,7 +155,7 @@ impl Data {
|
|||
pub fn queued_requests(
|
||||
&self,
|
||||
destination: &Destination,
|
||||
) -> impl Stream<Item = QueueItem> + Send + '_ {
|
||||
) -> impl Stream<Item = QueueItem> + Send + '_ + use<'_> {
|
||||
let prefix = destination.get_prefix();
|
||||
self.servernameevent_data
|
||||
.raw_stream_from(&prefix)
|
||||
|
|
|
@ -12,15 +12,15 @@ use std::{
|
|||
|
||||
use async_trait::async_trait;
|
||||
use conduwuit::{
|
||||
debug, debug_warn, err, error,
|
||||
Result, Server, debug, debug_warn, err, error,
|
||||
smallvec::SmallVec,
|
||||
utils::{available_parallelism, math::usize_from_u64_truncated, ReadyExt, TryReadyExt},
|
||||
warn, Result, Server,
|
||||
utils::{ReadyExt, TryReadyExt, available_parallelism, math::usize_from_u64_truncated},
|
||||
warn,
|
||||
};
|
||||
use futures::{FutureExt, Stream, StreamExt};
|
||||
use ruma::{
|
||||
api::{appservice::Registration, OutgoingRequest},
|
||||
RoomId, ServerName, UserId,
|
||||
api::{OutgoingRequest, appservice::Registration},
|
||||
};
|
||||
use tokio::{task, task::JoinSet};
|
||||
|
||||
|
@ -30,8 +30,8 @@ pub use self::{
|
|||
sender::{EDU_LIMIT, PDU_LIMIT},
|
||||
};
|
||||
use crate::{
|
||||
account_data, client, federation, globals, presence, pusher, rooms,
|
||||
rooms::timeline::RawPduId, users, Dep,
|
||||
Dep, account_data, client, federation, globals, presence, pusher, rooms,
|
||||
rooms::timeline::RawPduId, users,
|
||||
};
|
||||
|
||||
pub struct Service {
|
||||
|
|
|
@ -2,32 +2,33 @@ use std::{
|
|||
collections::{BTreeMap, HashMap, HashSet},
|
||||
fmt::Debug,
|
||||
sync::{
|
||||
atomic::{AtomicU64, AtomicUsize, Ordering},
|
||||
Arc,
|
||||
atomic::{AtomicU64, AtomicUsize, Ordering},
|
||||
},
|
||||
time::{Duration, Instant},
|
||||
};
|
||||
|
||||
use base64::{engine::general_purpose::URL_SAFE_NO_PAD, Engine as _};
|
||||
use base64::{Engine as _, engine::general_purpose::URL_SAFE_NO_PAD};
|
||||
use conduwuit::{
|
||||
debug, err, error,
|
||||
Error, Result, debug, err, error,
|
||||
result::LogErr,
|
||||
trace,
|
||||
utils::{
|
||||
calculate_hash, continue_exponential_backoff_secs,
|
||||
ReadyExt, calculate_hash, continue_exponential_backoff_secs,
|
||||
future::TryExtExt,
|
||||
stream::{BroadbandExt, IterStream, WidebandExt},
|
||||
ReadyExt,
|
||||
},
|
||||
warn, Error, Result,
|
||||
warn,
|
||||
};
|
||||
use futures::{
|
||||
FutureExt, StreamExt,
|
||||
future::{BoxFuture, OptionFuture},
|
||||
join, pin_mut,
|
||||
stream::FuturesUnordered,
|
||||
FutureExt, StreamExt,
|
||||
};
|
||||
use ruma::{
|
||||
CanonicalJsonObject, MilliSecondsSinceUnixEpoch, OwnedRoomId, OwnedServerName, OwnedUserId,
|
||||
RoomId, RoomVersionId, ServerName, UInt,
|
||||
api::{
|
||||
appservice::event::push_events::v1::EphemeralData,
|
||||
federation::transactions::{
|
||||
|
@ -40,18 +41,17 @@ use ruma::{
|
|||
},
|
||||
device_id,
|
||||
events::{
|
||||
push_rules::PushRulesEvent, receipt::ReceiptType, AnySyncEphemeralRoomEvent,
|
||||
GlobalAccountDataEventType,
|
||||
AnySyncEphemeralRoomEvent, GlobalAccountDataEventType, push_rules::PushRulesEvent,
|
||||
receipt::ReceiptType,
|
||||
},
|
||||
push,
|
||||
serde::Raw,
|
||||
uint, CanonicalJsonObject, MilliSecondsSinceUnixEpoch, OwnedRoomId, OwnedServerName,
|
||||
OwnedUserId, RoomId, RoomVersionId, ServerName, UInt,
|
||||
uint,
|
||||
};
|
||||
use serde_json::value::{to_raw_value, RawValue as RawJsonValue};
|
||||
use serde_json::value::{RawValue as RawJsonValue, to_raw_value};
|
||||
|
||||
use super::{
|
||||
appservice, data::QueueItem, Destination, EduBuf, EduVec, Msg, SendingEvent, Service,
|
||||
Destination, EduBuf, EduVec, Msg, SendingEvent, Service, appservice, data::QueueItem,
|
||||
};
|
||||
|
||||
#[derive(Debug)]
|
||||
|
@ -146,7 +146,7 @@ impl Service {
|
|||
statuses.entry(dest).and_modify(|e| {
|
||||
*e = match e {
|
||||
| TransactionStatus::Running => TransactionStatus::Failed(1, Instant::now()),
|
||||
| TransactionStatus::Retrying(ref n) =>
|
||||
| &mut TransactionStatus::Retrying(ref n) =>
|
||||
TransactionStatus::Failed(n.saturating_add(1), Instant::now()),
|
||||
| TransactionStatus::Failed(..) => {
|
||||
panic!("Request that was not even running failed?!")
|
||||
|
@ -211,7 +211,7 @@ impl Service {
|
|||
async fn finish_responses<'a>(&'a self, futures: &mut SendingFutures<'a>) {
|
||||
use tokio::{
|
||||
select,
|
||||
time::{sleep_until, Instant},
|
||||
time::{Instant, sleep_until},
|
||||
};
|
||||
|
||||
let timeout = self.server.config.sender_shutdown_timeout;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue