diff --git a/changelog.d/17904.feature b/changelog.d/17904.feature new file mode 100644 index 0000000000..4f161c69ea --- /dev/null +++ b/changelog.d/17904.feature @@ -0,0 +1 @@ +Allow Admin API delete room v2 actions to be run on workers. \ No newline at end of file diff --git a/docker/configure_workers_and_start.py b/docker/configure_workers_and_start.py index 8d6a3ca21b..12b908508d 100755 --- a/docker/configure_workers_and_start.py +++ b/docker/configure_workers_and_start.py @@ -136,12 +136,11 @@ WORKERS_CONFIG: Dict[str, Dict[str, Any]] = { "worker_extra_conf": "enable_media_repo: true", }, "admin": { - "app": "synapse.app.generic_worker", - "listener_resources": ["replication", "admin"], - "endpoint_patterns": ["^/_synapse/admin/v2/rooms/.*$"], - "shared_extra_conf": {}, - "worker_extra_conf": "", - + "app": "synapse.app.generic_worker", + "listener_resources": ["replication", "admin"], + "endpoint_patterns": ["^/_synapse/admin/v2/rooms/.*$"], + "shared_extra_conf": {}, + "worker_extra_conf": "", }, "appservice": { "app": "synapse.app.generic_worker", @@ -582,7 +581,7 @@ def is_sharding_allowed_for_worker_type(worker_type: str) -> bool: "receipts", "typing", "to_device", - "admin" + "admin", ] diff --git a/synapse/app/generic_worker.py b/synapse/app/generic_worker.py index 06259fc61d..35b4f1761b 100644 --- a/synapse/app/generic_worker.py +++ b/synapse/app/generic_worker.py @@ -28,12 +28,13 @@ from twisted.web.resource import Resource import synapse import synapse.events from synapse.api.urls import ( + ADMIN_PREFIX, CLIENT_API_PREFIX, FEDERATION_PREFIX, LEGACY_MEDIA_PREFIX, MEDIA_R0_PREFIX, MEDIA_V3_PREFIX, - SERVER_KEY_PREFIX, ADMIN_PREFIX, + SERVER_KEY_PREFIX, ) from synapse.app import _base from synapse.app._base import ( @@ -52,7 +53,7 @@ from synapse.logging.context import LoggingContext from synapse.metrics import METRICS_PREFIX, MetricsResource, RegistryProxy from synapse.replication.http import REPLICATION_PREFIX, ReplicationRestResource from synapse.rest import ClientRestResource -from synapse.rest.admin import register_servlets_for_media_repo, AdminRestResource +from synapse.rest.admin import AdminRestResource, register_servlets_for_media_repo from synapse.rest.health import HealthResource from synapse.rest.key.v2 import KeyResource from synapse.rest.synapse.client import build_synapse_client_resource_tree diff --git a/synapse/config/server.py b/synapse/config/server.py index 53856d3866..f41e775f84 100644 --- a/synapse/config/server.py +++ b/synapse/config/server.py @@ -191,7 +191,7 @@ KNOWN_RESOURCES = { "openid", "replication", "static", - "admin" + "admin", } diff --git a/synapse/storage/databases/main/room.py b/synapse/storage/databases/main/room.py index 9ebf48c00b..aa28290a32 100644 --- a/synapse/storage/databases/main/room.py +++ b/synapse/storage/databases/main/room.py @@ -2519,7 +2519,6 @@ class RoomStore(RoomBackgroundUpdateStore, RoomWorkerStore): ) return next_id - async def unblock_room(self, room_id: str) -> None: """Remove the room from blocking list.