summary refs log tree commit diff
path: root/synapse/config/_base.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2023-09-13 11:12:26 +0100
committerErik Johnston <erik@matrix.org>2023-09-13 11:12:26 +0100
commit3bb8cce692532ac61494c1767720d3bc9d60f08e (patch)
tree58b737f49bfe29959a8fb455df3ea57db87ac296 /synapse/config/_base.py
parentMerge branch 'release-v1.92' into matrix-org-hotfixes (diff)
parentImprove logging of replication (#16309) (diff)
downloadsynapse-3bb8cce692532ac61494c1767720d3bc9d60f08e.tar.xz
Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes
Diffstat (limited to 'synapse/config/_base.py')
-rw-r--r--synapse/config/_base.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/synapse/config/_base.py b/synapse/config/_base.py

index 69a8318127..58856839e1 100644 --- a/synapse/config/_base.py +++ b/synapse/config/_base.py
@@ -179,8 +179,9 @@ class Config: If an integer is provided it is treated as bytes and is unchanged. - String byte sizes can have a suffix of 'K' or `M`, representing kibibytes and - mebibytes respectively. No suffix is understood as a plain byte count. + String byte sizes can have a suffix of 'K', `M`, `G` or `T`, + representing kibibytes, mebibytes, gibibytes and tebibytes respectively. + No suffix is understood as a plain byte count. Raises: TypeError, if given something other than an integer or a string @@ -189,7 +190,7 @@ class Config: if type(value) is int: # noqa: E721 return value elif isinstance(value, str): - sizes = {"K": 1024, "M": 1024 * 1024} + sizes = {"K": 1024, "M": 1024 * 1024, "G": 1024**3, "T": 1024**4} size = 1 suffix = value[-1] if suffix in sizes: