Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Matrix
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Container Registry
Model registry
Operate
Environments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TeDomum
Matrix
Commits
ab335edb
Commit
ab335edb
authored
7 years ago
by
Erik Johnston
Browse files
Options
Downloads
Patches
Plain Diff
Revert "move _state_group_cache to statestore"
This reverts commit
f5cf3638
.
parent
bfbf1e1f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
synapse/storage/_base.py
+6
-0
6 additions, 0 deletions
synapse/storage/_base.py
synapse/storage/state.py
+7
-12
7 additions, 12 deletions
synapse/storage/state.py
with
13 additions
and
12 deletions
synapse/storage/_base.py
+
6
−
0
View file @
ab335edb
...
...
@@ -16,6 +16,8 @@ import logging
from
synapse.api.errors
import
StoreError
from
synapse.util.logcontext
import
LoggingContext
,
PreserveLoggingContext
from
synapse.util.caches
import
CACHE_SIZE_FACTOR
from
synapse.util.caches.dictionary_cache
import
DictionaryCache
from
synapse.util.caches.descriptors
import
Cache
from
synapse.storage.engines
import
PostgresEngine
import
synapse.metrics
...
...
@@ -178,6 +180,10 @@ class SQLBaseStore(object):
self
.
_get_event_cache
=
Cache
(
"
*getEvent*
"
,
keylen
=
3
,
max_entries
=
hs
.
config
.
event_cache_size
)
self
.
_state_group_cache
=
DictionaryCache
(
"
*stateGroupCache*
"
,
100000
*
CACHE_SIZE_FACTOR
)
self
.
_event_fetch_lock
=
threading
.
Condition
()
self
.
_event_fetch_list
=
[]
self
.
_event_fetch_ongoing
=
0
...
...
This diff is collapsed.
Click to expand it.
synapse/storage/state.py
+
7
−
12
View file @
ab335edb
...
...
@@ -13,17 +13,16 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from
collections
import
namedtuple
import
logging
from
._base
import
SQLBaseStore
from
synapse.util.caches.descriptors
import
cached
,
cachedList
from
synapse.util.caches
import
intern_string
from
synapse.util.stringutils
import
to_ascii
from
synapse.storage.engines
import
PostgresEngine
from
twisted.internet
import
defer
from
collections
import
namedtuple
from
synapse.storage.engines
import
PostgresEngine
from
synapse.util.caches
import
intern_string
,
CACHE_SIZE_FACTOR
from
synapse.util.caches.descriptors
import
cached
,
cachedList
from
synapse.util.caches.dictionary_cache
import
DictionaryCache
from
synapse.util.stringutils
import
to_ascii
from
._base
import
SQLBaseStore
import
logging
logger
=
logging
.
getLogger
(
__name__
)
...
...
@@ -82,10 +81,6 @@ class StateStore(SQLBaseStore):
where_clause
=
"
type=
'
m.room.member
'"
,
)
self
.
_state_group_cache
=
DictionaryCache
(
"
*stateGroupCache*
"
,
100000
*
CACHE_SIZE_FACTOR
)
@cached
(
max_entries
=
100000
,
iterable
=
True
)
def
get_current_state_ids
(
self
,
room_id
):
"""
Get the current state event ids for a room based on the
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment