mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-17 05:02:11 -04:00
Change DataStores to accept 'database' param.
This commit is contained in:
parent
f3ea2f5a08
commit
9a4fb457cf
41 changed files with 156 additions and 114 deletions
|
@ -24,6 +24,7 @@ from synapse.appservice import AppServiceTransaction
|
|||
from synapse.config.appservice import load_appservices
|
||||
from synapse.storage._base import SQLBaseStore
|
||||
from synapse.storage.data_stores.main.events_worker import EventsWorkerStore
|
||||
from synapse.storage.database import Database
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
@ -48,13 +49,13 @@ def _make_exclusive_regex(services_cache):
|
|||
|
||||
|
||||
class ApplicationServiceWorkerStore(SQLBaseStore):
|
||||
def __init__(self, db_conn, hs):
|
||||
def __init__(self, database: Database, db_conn, hs):
|
||||
self.services_cache = load_appservices(
|
||||
hs.hostname, hs.config.app_service_config_files
|
||||
)
|
||||
self.exclusive_user_regex = _make_exclusive_regex(self.services_cache)
|
||||
|
||||
super(ApplicationServiceWorkerStore, self).__init__(db_conn, hs)
|
||||
super(ApplicationServiceWorkerStore, self).__init__(database, db_conn, hs)
|
||||
|
||||
def get_app_services(self):
|
||||
return self.services_cache
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue