mirror of
https://gitlab.computer.surgery/matrix/grapevine.git
synced 2025-12-17 15:51:23 +01:00
add constructor for lazy-loading service
This commit is contained in:
parent
3b28d0cfda
commit
a083ff9200
2 changed files with 11 additions and 7 deletions
|
|
@ -11,10 +11,10 @@ mod data;
|
|||
pub(crate) use data::Data;
|
||||
|
||||
pub(crate) struct Service {
|
||||
pub(crate) db: &'static dyn Data,
|
||||
db: &'static dyn Data,
|
||||
|
||||
#[allow(clippy::type_complexity)]
|
||||
pub(crate) lazy_load_waiting: Mutex<
|
||||
lazy_load_waiting: Mutex<
|
||||
HashMap<
|
||||
(OwnedUserId, OwnedDeviceId, OwnedRoomId, PduCount),
|
||||
HashSet<OwnedUserId>,
|
||||
|
|
@ -23,6 +23,13 @@ pub(crate) struct Service {
|
|||
}
|
||||
|
||||
impl Service {
|
||||
pub(crate) fn new(db: &'static dyn Data) -> Self {
|
||||
Self {
|
||||
db,
|
||||
lazy_load_waiting: Mutex::new(HashMap::new()),
|
||||
}
|
||||
}
|
||||
|
||||
#[tracing::instrument(skip(self))]
|
||||
pub(crate) fn lazy_load_was_sent_before(
|
||||
&self,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue