mirror of
https://mau.dev/maunium/synapse.git
synced 2024-12-17 16:43:52 +01:00
Don't double json encode typing replication data
This commit is contained in:
parent
f10ce8944b
commit
96b9b6c127
2 changed files with 2 additions and 6 deletions
|
@ -62,7 +62,6 @@ import sys
|
||||||
import logging
|
import logging
|
||||||
import contextlib
|
import contextlib
|
||||||
import gc
|
import gc
|
||||||
import ujson as json
|
|
||||||
|
|
||||||
logger = logging.getLogger("synapse.app.synchrotron")
|
logger = logging.getLogger("synapse.app.synchrotron")
|
||||||
|
|
||||||
|
@ -215,9 +214,8 @@ class SynchrotronTyping(object):
|
||||||
self._latest_room_serial = token
|
self._latest_room_serial = token
|
||||||
|
|
||||||
for row in rows:
|
for row in rows:
|
||||||
typing = json.loads(row.user_ids)
|
|
||||||
self._room_serials[row.room_id] = token
|
self._room_serials[row.room_id] = token
|
||||||
self._room_typing[row.room_id] = typing
|
self._room_typing[row.room_id] = row.user_ids
|
||||||
|
|
||||||
|
|
||||||
class SynchrotronApplicationService(object):
|
class SynchrotronApplicationService(object):
|
||||||
|
|
|
@ -24,7 +24,6 @@ from synapse.types import UserID, get_domain_from_id
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from collections import namedtuple
|
from collections import namedtuple
|
||||||
import ujson as json
|
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
@ -288,8 +287,7 @@ class TypingHandler(object):
|
||||||
for room_id, serial in self._room_serials.items():
|
for room_id, serial in self._room_serials.items():
|
||||||
if last_id < serial and serial <= current_id:
|
if last_id < serial and serial <= current_id:
|
||||||
typing = self._room_typing[room_id]
|
typing = self._room_typing[room_id]
|
||||||
typing_bytes = json.dumps(list(typing), ensure_ascii=False)
|
rows.append((serial, room_id, list(typing)))
|
||||||
rows.append((serial, room_id, typing_bytes))
|
|
||||||
rows.sort()
|
rows.sort()
|
||||||
return rows
|
return rows
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue