2016-06-03 09:58:03 +00:00
|
|
|
# Copyright 2015, 2016 OpenMarket Ltd
|
|
|
|
#
|
|
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
# you may not use this file except in compliance with the License.
|
|
|
|
# You may obtain a copy of the License at
|
|
|
|
#
|
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
#
|
|
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
# See the License for the specific language governing permissions and
|
|
|
|
# limitations under the License.
|
|
|
|
|
2021-10-22 17:15:41 +00:00
|
|
|
from typing import TYPE_CHECKING
|
|
|
|
|
2021-12-13 17:05:00 +00:00
|
|
|
from synapse.storage.database import DatabasePool, LoggingDatabaseConnection
|
2020-08-05 20:38:57 +00:00
|
|
|
from synapse.storage.databases.main.filtering import FilteringStore
|
2016-06-03 09:58:03 +00:00
|
|
|
|
2018-07-09 06:09:20 +00:00
|
|
|
from ._base import BaseSlavedStore
|
|
|
|
|
2021-10-22 17:15:41 +00:00
|
|
|
if TYPE_CHECKING:
|
|
|
|
from synapse.server import HomeServer
|
|
|
|
|
2016-06-03 09:58:03 +00:00
|
|
|
|
|
|
|
class SlavedFilteringStore(BaseSlavedStore):
|
2021-12-13 17:05:00 +00:00
|
|
|
def __init__(
|
|
|
|
self,
|
|
|
|
database: DatabasePool,
|
|
|
|
db_conn: LoggingDatabaseConnection,
|
|
|
|
hs: "HomeServer",
|
|
|
|
):
|
2020-09-18 13:56:44 +00:00
|
|
|
super().__init__(database, db_conn, hs)
|
2016-06-03 09:58:03 +00:00
|
|
|
|
2016-06-03 10:03:10 +00:00
|
|
|
# Filters are immutable so this cache doesn't need to be expired
|
2016-06-03 09:58:03 +00:00
|
|
|
get_user_filter = FilteringStore.__dict__["get_user_filter"]
|