Clean-up type hints in server config (#10915)

By using attrs instead of dicts to store configuration.

Also updates some of the attrs classes to use proper type
hints and auto_attribs.
This commit is contained in:
Patrick Cloke 2021-09-28 09:24:40 -04:00 committed by GitHub
parent c3ccad7785
commit eb2c7e51c4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 54 additions and 55 deletions

View file

@ -92,16 +92,16 @@ class PaginationHandler:
if hs.config.worker.run_background_tasks and hs.config.retention_enabled:
# Run the purge jobs described in the configuration file.
for job in hs.config.retention_purge_jobs:
for job in hs.config.server.retention_purge_jobs:
logger.info("Setting up purge job with config: %s", job)
self.clock.looping_call(
run_as_background_process,
job["interval"],
job.interval,
"purge_history_for_rooms_in_range",
self.purge_history_for_rooms_in_range,
job["shortest_max_lifetime"],
job["longest_max_lifetime"],
job.shortest_max_lifetime,
job.longest_max_lifetime,
)
async def purge_history_for_rooms_in_range(