Add a cache for get_event

This commit is contained in:
Mark Haines 2015-02-11 15:01:15 +00:00
parent d8324d5a2b
commit f5a70e0d2e
6 changed files with 43 additions and 5 deletions

View file

@ -24,6 +24,7 @@ class DatabaseConfig(Config):
self.database_path = ":memory:"
else:
self.database_path = self.abspath(args.database_path)
self.event_cache_size = self.parse_size(args.event_cache_size)
@classmethod
def add_arguments(cls, parser):
@ -33,6 +34,10 @@ class DatabaseConfig(Config):
"-d", "--database-path", default="homeserver.db",
help="The database name."
)
db_group.add_argument(
"--event-cache-size", default="100K",
help="Number of events to cache in memory."
)
@classmethod
def generate_config(cls, args, config_dir_path):