mirror of
https://github.com/element-hq/synapse.git
synced 2024-11-27 03:58:06 +03:00
PEP8
This commit is contained in:
parent
aca3193efb
commit
e7febf4fbb
3 changed files with 9 additions and 6 deletions
|
@ -128,7 +128,9 @@ class EventsStore(SQLBaseStore):
|
|||
is_new_state=is_new_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:
|
||||
pass
|
||||
|
||||
|
|
|
@ -15,12 +15,10 @@
|
|||
|
||||
from ._base import SQLBaseStore
|
||||
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 twisted.internet import defer
|
||||
|
||||
from blist import sorteddict
|
||||
import logging
|
||||
import ujson as json
|
||||
|
||||
|
|
|
@ -262,7 +262,8 @@ class StreamStore(SQLBaseStore):
|
|||
def f(txn):
|
||||
if from_id is not None:
|
||||
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"
|
||||
" AND m.user_id = ?"
|
||||
" AND e.stream_ordering > ? AND e.stream_ordering <= ?"
|
||||
|
@ -271,7 +272,8 @@ class StreamStore(SQLBaseStore):
|
|||
txn.execute(sql, (user_id, from_id, to_id,))
|
||||
else:
|
||||
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"
|
||||
" AND m.user_id = ?"
|
||||
" AND stream_ordering <= ?"
|
||||
|
@ -307,7 +309,8 @@ class StreamStore(SQLBaseStore):
|
|||
"SELECT c.room_id FROM history_visibility AS h"
|
||||
" INNER JOIN current_state_events AS c"
|
||||
" 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))
|
||||
)
|
||||
)
|
||||
|
|
Loading…
Reference in a new issue