1
0
Fork 0
mirror of https://github.com/element-hq/synapse.git synced 2024-12-20 02:24:54 +03:00
Commit graph

39 commits

Author SHA1 Message Date
Erik Johnston
23740eaa3d
Correctly mention previous copyright ()
During the migration the automated script to update the copyright
headers accidentally got rid of some of the existing copyright lines.
Reinstate them.
2024-01-23 11:26:48 +00:00
Patrick Cloke
8e1e62c9e0 Update license headers 2023-11-21 15:29:58 -05:00
Patrick Cloke
679c691f6f
Remove more usages of cursor_to_dict. ()
Mostly to improve type safety.
2023-10-26 15:12:28 -04:00
Patrick Cloke
9407d5ba78
Convert simple_select_list and simple_select_list_txn to return lists of tuples ()
This should use fewer allocations and improves type hints.
2023-10-26 13:01:36 -04:00
David Robertson
6525fd65ee
Log the details of background update failures () 2023-09-01 12:41:56 +01:00
Patrick Cloke
a8a46b1336
Replace simple_async_mock with AsyncMock ()
Python 3.8 has a native AsyncMock, use it instead of a custom
implementation.
2023-08-25 09:27:21 -04:00
Patrick Cloke
daf11e26ef
Replace make_awaitable with AsyncMock ()
Python 3.8 provides a native AsyncMock, we can replace the
homegrown version we have.
2023-08-24 19:38:46 -04:00
Erik Johnston
e55a9b3e41
Fix downgrading to previous version of Synapse ()
We do this by marking the constraint as deferrable.
2023-07-10 16:24:42 +01:00
Erik Johnston
95a96b21eb
Add foreign key constraint to event_forward_extremities. () 2023-07-05 09:43:19 +00:00
Dirk Klimpel
9d21ecf7ce
Add type hints to tests files. () 2022-03-21 09:43:16 -04:00
Shay
ef3619e61d
Add config settings for background update parameters () 2022-03-11 10:46:45 -08:00
Shay
26211fec24
Fix a bug in background updates wherein background updates are never run using the default batch size () 2022-03-07 09:44:33 -08:00
Richard van der Hoff
e24ff8ebe3
Remove HomeServer.get_datastore() ()
The presence of this method was confusing, and mostly present for backwards
compatibility. Let's get rid of it.

Part of 
2022-02-23 11:04:02 +00:00
V02460
7a7ca8f226
Use mock from standard library ()
Instead of the backported version.
2021-12-20 10:34:46 -05:00
Patrick Cloke
ed635d3285
Add a license header and comment. () 2021-12-01 12:51:14 -05:00
Erik Johnston
d08ef6f155
Make background updates controllable via a plugin ()
Co-authored-by: Brendan Abolivier <babolivier@matrix.org>
2021-11-29 17:57:06 +01:00
Brendan Abolivier
7f9841bdec
Lower minumum batch size to 1 for background updates ()
Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
2021-11-24 19:21:44 +00:00
Jonathan de Jong
93729719b8
Use inline type hints in tests/ ()
This PR is tantamount to running:

    python3.8 -m com2ann -v 6 tests/

(com2ann requires python 3.8 to run)
2021-07-13 11:52:58 +01:00
Patrick Cloke
0b3112123d
Use mock from the stdlib. () 2021-04-09 13:44:38 -04:00
Eric Eastwood
0a00b7ff14
Update black, and run auto formatting over the codebase ()
- Update black version to the latest
 - Run black auto formatting over the codebase
    - Run autoformatting according to [`docs/code_style.md
`](80d6dc9783/docs/code_style.md)
 - Update `code_style.md` docs around installing black to use the correct version
2021-02-16 22:32:34 +00:00
Patrick Cloke
e00816ad98
Do not yield on awaitables in tests. () 2020-08-27 17:24:46 -04:00
Patrick Cloke
30426c7063
Convert additional database methods to async (select list, search, insert_many, delete_*) () 2020-08-27 07:41:01 -04:00
Erik Johnston
a7bdf98d01
Rename database classes to make some sense () 2020-08-05 21:38:57 +01:00
Richard van der Hoff
b4c2234232 Make do_next_background_update return a bool
returning a None or an int that we don't use is confusing.
2020-03-31 17:43:58 +01:00
Richard van der Hoff
26d17b9bdc Make has_completed_background_updates async
(Almost) everywhere that uses it is happy with an awaitable.
2020-03-31 17:43:58 +01:00
Richard van der Hoff
cfe8c8ab8e Remove unused start_background_update
This was only used in a unit test, so let's just inline it in the test.
2020-03-31 17:24:06 +01:00
Richard van der Hoff
d20c346544
port BackgroundUpdateTestCase to HomeserverTestCase () 2020-01-07 14:09:07 +00:00
Erik Johnston
4a33a6dd19 Move background update handling out of store 2019-12-05 11:11:26 +00:00
Erik Johnston
756d4942f5 Move DB pool and helper functions into dedicated Database class 2019-12-05 10:46:37 +00:00
Amber Brown
4806651744
Replace returnValue with return () 2019-07-23 23:00:55 +10:00
Amber Brown
b36c82576e
Run Black on the tests again () 2019-05-10 00:12:11 -05:00
Amber Brown
3f189c902e
Fix flake8 () 2019-01-30 10:53:17 +00:00
Amber Brown
99dd975dae
Run tests under PostgreSQL () 2018-08-13 16:47:46 +10:00
black
8b3d9b6b19 Run black. 2018-08-10 23:54:09 +10:00
Amber Brown
49af402019 run isort 2018-07-09 16:09:20 +10:00
Richard van der Hoff
42f4feb2b7 PEP8 2016-07-25 12:25:06 +01:00
Richard van der Hoff
465117d7ca Fix background_update tests
A bit of a cleanup for background_updates, and make sure that the real
background updates have run before we start the unit tests, so that they don't
interfere with the tests.
2016-07-25 12:10:42 +01:00
Mark Haines
700487a7c7 Fix flake8 warnings for tests 2016-02-19 15:34:38 +00:00
Mark Haines
36c58b18a3 Test for background updates 2015-11-10 15:51:40 +00:00