Reduce unnecessary whitespace in JSON. (#7372)

This commit is contained in:
David Vo 2020-08-07 22:02:55 +10:00 committed by GitHub
parent 2ffd6783c7
commit 4dd27e6d11
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 56 additions and 53 deletions

View file

@ -17,6 +17,7 @@ import logging
import re
import attr
from canonicaljson import json
from twisted.internet import defer, task
@ -24,6 +25,9 @@ from synapse.logging import context
logger = logging.getLogger(__name__)
# Create a custom encoder to reduce the whitespace produced by JSON encoding.
json_encoder = json.JSONEncoder(separators=(",", ":"))
def unwrapFirstError(failure):
# defer.gatherResults and DeferredLists wrap failures.