forked from MirrorHub/synapse
Merge pull request #6470 from matrix-org/babolivier/port_db_ci_failure
Make synapse_port_db exit with a non-0 code if something failed
This commit is contained in:
commit
fe799f353d
3 changed files with 14 additions and 2 deletions
1
changelog.d/6470.bugfix
Normal file
1
changelog.d/6470.bugfix
Normal file
|
@ -0,0 +1 @@
|
||||||
|
Fix `synapse_port_db` not exiting with a 0 code if something went wrong during the port process.
|
|
@ -47,6 +47,7 @@ from synapse.storage.data_stores.main.media_repository import (
|
||||||
from synapse.storage.data_stores.main.registration import (
|
from synapse.storage.data_stores.main.registration import (
|
||||||
RegistrationBackgroundUpdateStore,
|
RegistrationBackgroundUpdateStore,
|
||||||
)
|
)
|
||||||
|
from synapse.storage.data_stores.main.room import RoomBackgroundUpdateStore
|
||||||
from synapse.storage.data_stores.main.roommember import RoomMemberBackgroundUpdateStore
|
from synapse.storage.data_stores.main.roommember import RoomMemberBackgroundUpdateStore
|
||||||
from synapse.storage.data_stores.main.search import SearchBackgroundUpdateStore
|
from synapse.storage.data_stores.main.search import SearchBackgroundUpdateStore
|
||||||
from synapse.storage.data_stores.main.state import StateBackgroundUpdateStore
|
from synapse.storage.data_stores.main.state import StateBackgroundUpdateStore
|
||||||
|
@ -131,6 +132,7 @@ class Store(
|
||||||
EventsBackgroundUpdatesStore,
|
EventsBackgroundUpdatesStore,
|
||||||
MediaRepositoryBackgroundUpdateStore,
|
MediaRepositoryBackgroundUpdateStore,
|
||||||
RegistrationBackgroundUpdateStore,
|
RegistrationBackgroundUpdateStore,
|
||||||
|
RoomBackgroundUpdateStore,
|
||||||
RoomMemberBackgroundUpdateStore,
|
RoomMemberBackgroundUpdateStore,
|
||||||
SearchBackgroundUpdateStore,
|
SearchBackgroundUpdateStore,
|
||||||
StateBackgroundUpdateStore,
|
StateBackgroundUpdateStore,
|
||||||
|
@ -1055,3 +1057,4 @@ if __name__ == "__main__":
|
||||||
if end_error_exec_info:
|
if end_error_exec_info:
|
||||||
exc_type, exc_value, exc_traceback = end_error_exec_info
|
exc_type, exc_value, exc_traceback = end_error_exec_info
|
||||||
traceback.print_exception(exc_type, exc_value, exc_traceback)
|
traceback.print_exception(exc_type, exc_value, exc_traceback)
|
||||||
|
sys.exit(5)
|
||||||
|
|
|
@ -28,6 +28,7 @@ from twisted.internet import defer
|
||||||
from synapse.api.constants import EventTypes
|
from synapse.api.constants import EventTypes
|
||||||
from synapse.api.errors import StoreError
|
from synapse.api.errors import StoreError
|
||||||
from synapse.storage._base import SQLBaseStore
|
from synapse.storage._base import SQLBaseStore
|
||||||
|
from synapse.storage.background_updates import BackgroundUpdateStore
|
||||||
from synapse.storage.data_stores.main.search import SearchStore
|
from synapse.storage.data_stores.main.search import SearchStore
|
||||||
from synapse.types import ThirdPartyInstanceID
|
from synapse.types import ThirdPartyInstanceID
|
||||||
from synapse.util.caches.descriptors import cached, cachedInlineCallbacks
|
from synapse.util.caches.descriptors import cached, cachedInlineCallbacks
|
||||||
|
@ -360,9 +361,9 @@ class RoomWorkerStore(SQLBaseStore):
|
||||||
defer.returnValue(row)
|
defer.returnValue(row)
|
||||||
|
|
||||||
|
|
||||||
class RoomStore(RoomWorkerStore, SearchStore):
|
class RoomBackgroundUpdateStore(BackgroundUpdateStore):
|
||||||
def __init__(self, db_conn, hs):
|
def __init__(self, db_conn, hs):
|
||||||
super(RoomStore, self).__init__(db_conn, hs)
|
super(RoomBackgroundUpdateStore, self).__init__(db_conn, hs)
|
||||||
|
|
||||||
self.config = hs.config
|
self.config = hs.config
|
||||||
|
|
||||||
|
@ -438,6 +439,13 @@ class RoomStore(RoomWorkerStore, SearchStore):
|
||||||
|
|
||||||
defer.returnValue(batch_size)
|
defer.returnValue(batch_size)
|
||||||
|
|
||||||
|
|
||||||
|
class RoomStore(RoomBackgroundUpdateStore, RoomWorkerStore, SearchStore):
|
||||||
|
def __init__(self, db_conn, hs):
|
||||||
|
super(RoomStore, self).__init__(db_conn, hs)
|
||||||
|
|
||||||
|
self.config = hs.config
|
||||||
|
|
||||||
@defer.inlineCallbacks
|
@defer.inlineCallbacks
|
||||||
def store_room(self, room_id, room_creator_user_id, is_public):
|
def store_room(self, room_id, room_creator_user_id, is_public):
|
||||||
"""Stores a room.
|
"""Stores a room.
|
||||||
|
|
Loading…
Reference in a new issue