aboutsummaryrefslogtreecommitdiff
path: root/syncapi/streams/streams.go
diff options
context:
space:
mode:
authorTill <2353100+S7evinK@users.noreply.github.com>2022-04-19 10:46:45 +0200
committerGitHub <noreply@github.com>2022-04-19 09:46:45 +0100
commit57e3622b85fd4d80d9826404135f09e91ed47973 (patch)
treeecedc835dfd4b6eb21ff3b028df8f43cfb65a01f /syncapi/streams/streams.go
parent3ddbffd59ece5f74d951d6209882d9d954db4bc3 (diff)
Implement lazy loading on `/sync` (#2346)
* Initial work on lazyloading * Partially implement lazy loading on /sync * Rename methods * Make missing tests pass * Preallocate slice, even if it will end up with fewer values * Let the cache handle the user mapping * Linter * Cap cache growth
Diffstat (limited to 'syncapi/streams/streams.go')
-rw-r--r--syncapi/streams/streams.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/syncapi/streams/streams.go b/syncapi/streams/streams.go
index c7d06a29..d3195b78 100644
--- a/syncapi/streams/streams.go
+++ b/syncapi/streams/streams.go
@@ -27,12 +27,12 @@ type Streams struct {
func NewSyncStreamProviders(
d storage.Database, userAPI userapi.UserInternalAPI,
rsAPI rsapi.RoomserverInternalAPI, keyAPI keyapi.KeyInternalAPI,
- eduCache *caching.EDUCache, notifier *notifier.Notifier,
+ eduCache *caching.EDUCache, lazyLoadCache *caching.LazyLoadCache, notifier *notifier.Notifier,
) *Streams {
streams := &Streams{
PDUStreamProvider: &PDUStreamProvider{
StreamProvider: StreamProvider{DB: d},
- userAPI: userAPI,
+ lazyLoadCache: lazyLoadCache,
},
TypingStreamProvider: &TypingStreamProvider{
StreamProvider: StreamProvider{DB: d},