mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2026-11-15 21:26:50 +00:00
Services refactor
Replace structs of Dep<Service> with OnceServices, so each service has a Services reference Remove service name => Service map Flatten Services.rooms Make reqwest Clients lazy initialized (client service)
This commit is contained in:
1 parent
26b3a84b88
commit
b5890b9664
118 files changed
+457
-1923
No files matched your search
@@ -46,7 +46,6 @@ pub(crate) async fn get_backfill_route(
|
||||
.stream()
|
||||
.filter_map(|event_id| {
|
||||
services
|
||||
.rooms
|
||||
.timeline
|
||||
.get_pdu_count(event_id)
|
||||
.map(Result::ok)
|
||||
@@ -60,13 +59,11 @@ pub(crate) async fn get_backfill_route(
|
||||
origin: services.globals.server_name().to_owned(),
|
||||
|
||||
pdus: services
|
||||
.rooms
|
||||
.timeline
|
||||
.pdus_rev(None, &body.room_id, Some(from.saturating_add(1)))
|
||||
.try_take(limit)
|
||||
.try_filter_map(async |(_, pdu)| {
|
||||
Ok(services
|
||||
.rooms
|
||||
.state_accessor
|
||||
.server_can_see_event(body.origin(), &pdu.room_id, &pdu.event_id)
|
||||
.await
|
||||
@@ -74,7 +71,6 @@ pub(crate) async fn get_backfill_route(
|
||||
})
|
||||
.try_filter_map(async |pdu| {
|
||||
Ok(services
|
||||
.rooms
|
||||
.timeline
|
||||
.get_pdu_json(&pdu.event_id)
|
||||
.await
|
||||
|
||||
Reference in new issue
Block a user