From 0a02b2a1c5dc25d04a5b3cb536bc0a3a0bf7cf19 Mon Sep 17 00:00:00 2001 From: "Amber H. Brown" Date: Fri, 17 Jan 2020 01:05:50 +1100 Subject: [PATCH] cleanup --- synapse/api/auth.py | 7 +------ synapse/app/homeserver.py | 7 ------- synapse/config/cache.py | 1 + synapse/replication/slave/storage/client_ips.py | 1 - synapse/server.py | 4 ---- synapse/storage/data_stores/main/client_ips.py | 1 - 6 files changed, 2 insertions(+), 19 deletions(-) diff --git a/synapse/api/auth.py b/synapse/api/auth.py index 86f7f5b144..be81ebccef 100644 --- a/synapse/api/auth.py +++ b/synapse/api/auth.py @@ -34,13 +34,8 @@ from synapse.api.errors import ( ResourceLimitError, ) from synapse.config.server import is_threepid_reserved -<<<<<<< HEAD -from synapse.types import UserID -from synapse.util.caches import register_cache -======= from synapse.types import StateMap, UserID -from synapse.util.caches import CACHE_SIZE_FACTOR, register_cache ->>>>>>> origin/develop +from synapse.util.caches import register_cache from synapse.util.caches.lrucache import LruCache from synapse.util.metrics import Measure diff --git a/synapse/app/homeserver.py b/synapse/app/homeserver.py index d86d924bea..0feb5bfa86 100644 --- a/synapse/app/homeserver.py +++ b/synapse/app/homeserver.py @@ -66,16 +66,9 @@ from synapse.rest.admin import AdminRestResource from synapse.rest.key.v2 import KeyApiV2Resource from synapse.rest.well_known import WellKnownResource from synapse.server import HomeServer -<<<<<<< HEAD -from synapse.storage import DataStore, are_all_users_on_domain -from synapse.storage.engines import IncorrectDatabaseSetup, create_engine -from synapse.storage.prepare_database import UpgradeDatabaseException, prepare_database -======= from synapse.storage import DataStore from synapse.storage.engines import IncorrectDatabaseSetup from synapse.storage.prepare_database import UpgradeDatabaseException -from synapse.util.caches import CACHE_SIZE_FACTOR ->>>>>>> origin/develop from synapse.util.httpresourcetree import create_resource_tree from synapse.util.manhole import manhole from synapse.util.module_loader import load_module diff --git a/synapse/config/cache.py b/synapse/config/cache.py index e72c6ff397..d7921ce050 100644 --- a/synapse/config/cache.py +++ b/synapse/config/cache.py @@ -46,6 +46,7 @@ _DEFAULT_CONFIG = """\ def add_resizable_cache(cache_name, cache_resize_callback): _CACHES[cache_name.lower()] = cache_resize_callback + cache_resize_callback(DEFAULT_CACHE_SIZE_FACTOR) class CacheConfig(Config): diff --git a/synapse/replication/slave/storage/client_ips.py b/synapse/replication/slave/storage/client_ips.py index f26258e677..1a38f53dfb 100644 --- a/synapse/replication/slave/storage/client_ips.py +++ b/synapse/replication/slave/storage/client_ips.py @@ -15,7 +15,6 @@ from synapse.storage.data_stores.main.client_ips import LAST_SEEN_GRANULARITY from synapse.storage.database import Database -from synapse.util.caches import CACHE_SIZE_FACTOR from synapse.util.caches.descriptors import Cache from ._base import BaseSlavedStore diff --git a/synapse/server.py b/synapse/server.py index 4247675224..7926867b77 100644 --- a/synapse/server.py +++ b/synapse/server.py @@ -239,11 +239,7 @@ class HomeServer(object): def setup(self): logger.info("Setting up.") self.start_time = int(self.get_clock().time()) -<<<<<<< HEAD - self.get_clock().looping_call(self.config.caches.resize_caches, 10000) -======= self.datastores = DataStores(self.DATASTORE_CLASS, self) ->>>>>>> origin/develop logger.info("Finished setting up.") def setup_master(self): diff --git a/synapse/storage/data_stores/main/client_ips.py b/synapse/storage/data_stores/main/client_ips.py index ae188d0f49..73acc162ed 100644 --- a/synapse/storage/data_stores/main/client_ips.py +++ b/synapse/storage/data_stores/main/client_ips.py @@ -22,7 +22,6 @@ from twisted.internet import defer from synapse.metrics.background_process_metrics import wrap_as_background_process from synapse.storage._base import SQLBaseStore from synapse.storage.database import Database -from synapse.util.caches import CACHE_SIZE_FACTOR from synapse.util.caches.descriptors import Cache logger = logging.getLogger(__name__)