mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2024-12-25 09:29:27 -05:00
Don't create empty AS txns when the AS is down (#12869)
This commit is contained in:
parent
2e5f88b5e6
commit
33e2916858
1
changelog.d/12869.misc
Normal file
1
changelog.d/12869.misc
Normal file
@ -0,0 +1 @@
|
|||||||
|
Don't generate empty AS transactions when the AS is flagged as down. Contributed by Nick @ Beeper.
|
@ -384,6 +384,11 @@ class _TransactionController:
|
|||||||
device_list_summary: The device list summary to include in the transaction.
|
device_list_summary: The device list summary to include in the transaction.
|
||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
|
service_is_up = await self._is_service_up(service)
|
||||||
|
# Don't create empty txns when in recovery mode (ephemeral events are dropped)
|
||||||
|
if not service_is_up and not events:
|
||||||
|
return
|
||||||
|
|
||||||
txn = await self.store.create_appservice_txn(
|
txn = await self.store.create_appservice_txn(
|
||||||
service=service,
|
service=service,
|
||||||
events=events,
|
events=events,
|
||||||
@ -393,7 +398,6 @@ class _TransactionController:
|
|||||||
unused_fallback_keys=unused_fallback_keys or {},
|
unused_fallback_keys=unused_fallback_keys or {},
|
||||||
device_list_summary=device_list_summary or DeviceListUpdates(),
|
device_list_summary=device_list_summary or DeviceListUpdates(),
|
||||||
)
|
)
|
||||||
service_is_up = await self._is_service_up(service)
|
|
||||||
if service_is_up:
|
if service_is_up:
|
||||||
sent = await txn.send(self.as_api)
|
sent = await txn.send(self.as_api)
|
||||||
if sent:
|
if sent:
|
||||||
|
Loading…
Reference in New Issue
Block a user