mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-06-07 05:32:37 -04:00
Consistently use db_to_json
to convert from database values to JSON objects. (#7849)
This commit is contained in:
parent
b0f031f92a
commit
f460da6031
22 changed files with 80 additions and 82 deletions
|
@ -17,12 +17,10 @@ import logging
|
|||
import re
|
||||
from collections import namedtuple
|
||||
|
||||
from canonicaljson import json
|
||||
|
||||
from twisted.internet import defer
|
||||
|
||||
from synapse.api.errors import SynapseError
|
||||
from synapse.storage._base import SQLBaseStore, make_in_list_sql_clause
|
||||
from synapse.storage._base import SQLBaseStore, db_to_json, make_in_list_sql_clause
|
||||
from synapse.storage.data_stores.main.events_worker import EventRedactBehaviour
|
||||
from synapse.storage.database import Database
|
||||
from synapse.storage.engines import PostgresEngine, Sqlite3Engine
|
||||
|
@ -157,7 +155,7 @@ class SearchBackgroundUpdateStore(SearchWorkerStore):
|
|||
stream_ordering = row["stream_ordering"]
|
||||
origin_server_ts = row["origin_server_ts"]
|
||||
try:
|
||||
event_json = json.loads(row["json"])
|
||||
event_json = db_to_json(row["json"])
|
||||
content = event_json["content"]
|
||||
except Exception:
|
||||
continue
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue