summary refs log tree commit diff
path: root/synapse/config/cache.py (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Correctly mention previous copyright (#16820)Erik Johnston2024-01-231-0/+1
| | | | | During the migration the automated script to update the copyright headers accidentally got rid of some of the existing copyright lines. Reinstate them.
* Update license headersPatrick Cloke2023-11-211-10/+16
|
* Prefer `type(x) is int` to `isinstance(x, int)` (#14945)David Robertson2023-01-311-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Perfer `type(x) is int` to `isinstance(x, int)` This covered all additional instances I could see where `x` was user-controlled. The remaining cases are ``` $ rg -s 'isinstance.*[^_]int' tests/replication/_base.py 576: if isinstance(obj, int): synapse/util/caches/stream_change_cache.py 136: assert isinstance(stream_pos, int) 214: assert isinstance(stream_pos, int) 246: assert isinstance(stream_pos, int) 267: assert isinstance(stream_pos, int) synapse/replication/tcp/external_cache.py 133: if isinstance(result, int): synapse/metrics/__init__.py 100: if isinstance(calls, (int, float)): synapse/handlers/appservice.py 262: assert isinstance(new_token, int) synapse/config/_util.py 62: if isinstance(p, int): ``` which cover metrics, logic related to `jsonschema`, and replication and data streams. AFAICS these are all internal to Synapse * Changelog
* Add missing type hints to tests.config. (#14681)Patrick Cloke2022-12-161-2/+2
|
* Fix `track_memory_usage` on poetry-core 1.3.x installations (#14221)David Robertson2022-10-181-1/+1
| | | | | | | | | | | | | * Fix `track_memory_usage` on poetry-core 1.3.x installations The same kind of problem as discussed in #14085: 1. we defined an extra with an underscore 2. we look it up at runtime with an underscore 3. but poetry-core 1.3.x. installs it with a dash, causing (2) to fail. Fix by using a dash everywhere. * Changelog
* Allow dependency errors to pass through (#13113)Jacek Kuśnierz2022-06-301-7/+2
| | | | Signed-off-by: Jacek Kusnierz <jacek.kusnierz@tum.de> Co-authored-by: Brendan Abolivier <babolivier@matrix.org>
* Change default `sync_response_cache_duration` (#13042)Erik Johnston2022-06-151-1/+1
|
* Remove code generating comments in configuration file (#12941)Shay2022-06-141-91/+0
|
* Add config flags to allow for cache auto-tuning (#12701)Shay2022-05-131-0/+33
|
* Reload cache factors from disk on SIGHUP (#12673)David Robertson2022-05-111-18/+31
|
* Add missing type hints to config classes. (#12402)Patrick Cloke2022-04-111-3/+4
|
* Use importlib.metadata to read requirements (#12088)David Robertson2022-03-011-1/+1
| | | | | | | | | | | | | | | | | | * Pull runtime dep checks into their own module * Reimplement `check_requirements` using `importlib` I've tried to make this clearer. We start by working out which of Synapse's requirements we need to be installed here and now. I was surprised that there wasn't an easier way to see which packages were installed by a given extra. I've pulled out the error messages into functions that deal with "is this for an extra or not". And I've rearranged the loop over two different sets of requirements into one loop with a "must be instaled" flag. I hope you agree that this is clearer. * Test cases
* Enable cache time-based expiry by default (#11849)Shay2022-02-111-7/+33
|
* Additional type hints for config module. (#11465)Patrick Cloke2021-12-011-12/+14
| | | | This adds some misc. type hints to helper methods used in the `synapse.config` module.
* Add missing type hints to config base classes (#11377)Patrick Cloke2021-11-231-2/+2
|
* Make sync response cache time configurable. (#10513)Richard van der Hoff2021-08-031-0/+13
|
* Use inline type hints in various other places (in `synapse/`) (#10380)Jonathan de Jong2021-07-151-2/+2
|
* Add support for evicting cache entries based on last access time. (#10205)Erik Johnston2021-07-051-29/+41
|
* Optionally track memory usage of each LruCache (#9881)Erik Johnston2021-05-051-0/+11
| | | | | This will double count slightly in the presence of interned strings. It's off by default as it can consume a lot of resources.
* Remove redundant "coding: utf-8" lines (#9786)Jonathan de Jong2021-04-141-1/+0
| | | | | | | Part of #9744 Removes all redundant `# -*- coding: utf-8 -*-` lines from files, as python 3 automatically reads source code as utf-8 now. `Signed-off-by: Jonathan de Jong <jonathan@automatia.nl>`
* Make it possible to use dmypy (#9692)Erik Johnston2021-03-261-2/+4
| | | | | | | | | Running `dmypy run` will do a `mypy` check while spinning up a daemon that makes rerunning `dmypy run` a lot faster. `dmypy` doesn't support `follow_imports = silent` and has `local_partial_types` enabled, so this PR enables those options and fixes the issues that were newly raised. Note that `local_partial_types` will be enabled by default in upcoming mypy releases.
* Stop sub-classing object (#8249)Patrick Cloke2020-09-041-1/+1
|
* Take out a lock before modifying _CACHES (#7663)Richard van der Hoff2020-06-101-5/+15
| | | | This should fix #7610.
* Fix up commentsErik Johnston2020-05-271-2/+2
|
* Fix specifying cache factors via env vars with * in name. (#7580)Erik Johnston2020-05-271-5/+39
| | | | | This mostly applise to `*stateGroupCache*` and co. Broke in #6391.
* Allow configuration of Synapse's cache without using synctl or environment ↵Amber Brown2020-05-111-0/+164
variables (#6391)