mirror of
https://mau.dev/maunium/synapse.git
synced 2024-12-14 21:33:53 +01:00
remove duplicate parse_size method
This commit is contained in:
parent
d624e2a638
commit
6b69ddd17a
2 changed files with 0 additions and 10 deletions
|
@ -406,7 +406,6 @@ def setup(config_options):
|
|||
redirect_root_to_web_client=True,
|
||||
)
|
||||
|
||||
|
||||
logger.info("Preparing database: %r...", config.database_config)
|
||||
|
||||
try:
|
||||
|
|
|
@ -22,15 +22,6 @@ class ContentRepositoryConfig(Config):
|
|||
self.max_image_pixels = self.parse_size(config["max_image_pixels"])
|
||||
self.media_store_path = self.ensure_directory(config["media_store_path"])
|
||||
|
||||
def parse_size(self, string):
|
||||
sizes = {"K": 1024, "M": 1024 * 1024}
|
||||
size = 1
|
||||
suffix = string[-1]
|
||||
if suffix in sizes:
|
||||
string = string[:-1]
|
||||
size = sizes[suffix]
|
||||
return int(string) * size
|
||||
|
||||
def default_config(self, config_dir_path, server_name):
|
||||
media_store = self.default_path("media_store")
|
||||
return """
|
||||
|
|
Loading…
Reference in a new issue