mirror of
https://mau.dev/maunium/synapse.git
synced 2024-09-05 09:02:13 +00:00
PEP8
This commit is contained in:
parent
aca3193efb
commit
e7febf4fbb
@ -128,7 +128,9 @@ class EventsStore(SQLBaseStore):
|
|||||||
is_new_state=is_new_state,
|
is_new_state=is_new_state,
|
||||||
current_state=current_state,
|
current_state=current_state,
|
||||||
)
|
)
|
||||||
self._events_stream_cache.room_has_changed(None, event.room_id, stream_ordering)
|
self._events_stream_cache.room_has_changed(
|
||||||
|
None, event.room_id, stream_ordering
|
||||||
|
)
|
||||||
except _RollbackButIsFineException:
|
except _RollbackButIsFineException:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
@ -15,12 +15,10 @@
|
|||||||
|
|
||||||
from ._base import SQLBaseStore
|
from ._base import SQLBaseStore
|
||||||
from synapse.util.caches.descriptors import cachedInlineCallbacks, cachedList, cached
|
from synapse.util.caches.descriptors import cachedInlineCallbacks, cachedList, cached
|
||||||
from synapse.util.caches import cache_counter, caches_by_name
|
|
||||||
from synapse.util.caches.room_change_cache import RoomStreamChangeCache
|
from synapse.util.caches.room_change_cache import RoomStreamChangeCache
|
||||||
|
|
||||||
from twisted.internet import defer
|
from twisted.internet import defer
|
||||||
|
|
||||||
from blist import sorteddict
|
|
||||||
import logging
|
import logging
|
||||||
import ujson as json
|
import ujson as json
|
||||||
|
|
||||||
|
@ -262,7 +262,8 @@ class StreamStore(SQLBaseStore):
|
|||||||
def f(txn):
|
def f(txn):
|
||||||
if from_id is not None:
|
if from_id is not None:
|
||||||
sql = (
|
sql = (
|
||||||
"SELECT m.event_id, stream_ordering FROM events AS e, room_memberships AS m"
|
"SELECT m.event_id, stream_ordering FROM events AS e,"
|
||||||
|
" room_memberships AS m"
|
||||||
" WHERE e.event_id = m.event_id"
|
" WHERE e.event_id = m.event_id"
|
||||||
" AND m.user_id = ?"
|
" AND m.user_id = ?"
|
||||||
" AND e.stream_ordering > ? AND e.stream_ordering <= ?"
|
" AND e.stream_ordering > ? AND e.stream_ordering <= ?"
|
||||||
@ -271,7 +272,8 @@ class StreamStore(SQLBaseStore):
|
|||||||
txn.execute(sql, (user_id, from_id, to_id,))
|
txn.execute(sql, (user_id, from_id, to_id,))
|
||||||
else:
|
else:
|
||||||
sql = (
|
sql = (
|
||||||
"SELECT m.event_id, stream_ordering FROM events AS e, room_memberships AS m"
|
"SELECT m.event_id, stream_ordering FROM events AS e,"
|
||||||
|
" room_memberships AS m"
|
||||||
" WHERE e.event_id = m.event_id"
|
" WHERE e.event_id = m.event_id"
|
||||||
" AND m.user_id = ?"
|
" AND m.user_id = ?"
|
||||||
" AND stream_ordering <= ?"
|
" AND stream_ordering <= ?"
|
||||||
@ -307,7 +309,8 @@ class StreamStore(SQLBaseStore):
|
|||||||
"SELECT c.room_id FROM history_visibility AS h"
|
"SELECT c.room_id FROM history_visibility AS h"
|
||||||
" INNER JOIN current_state_events AS c"
|
" INNER JOIN current_state_events AS c"
|
||||||
" ON h.event_id = c.event_id"
|
" ON h.event_id = c.event_id"
|
||||||
" WHERE c.room_id IN (%s) AND h.history_visibility = 'world_readable'" % (
|
" WHERE c.room_id IN (%s)"
|
||||||
|
" AND h.history_visibility = 'world_readable'" % (
|
||||||
",".join(map(lambda _: "?", room_ids))
|
",".join(map(lambda _: "?", room_ids))
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user