diff options
author | Dirk Klimpel <5740567+dklimpel@users.noreply.github.com> | 2022-01-05 20:46:50 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-05 14:46:50 -0500 |
commit | 3b51c763ba5601e155e3e27a46cddf0370da83eb (patch) | |
tree | ada08d68211cceeb2107666caf1328a6380101a0 /synapse/storage/databases/main/transactions.py | |
parent | Run `pyupgrade --py37-plus --keep-percent-format` on Synapse (#11685) (diff) | |
download | synapse-3b51c763ba5601e155e3e27a46cddf0370da83eb.tar.xz |
Fix get federation status of destination if no error occured (#11593)
Diffstat (limited to 'synapse/storage/databases/main/transactions.py')
-rw-r--r-- | synapse/storage/databases/main/transactions.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/synapse/storage/databases/main/transactions.py b/synapse/storage/databases/main/transactions.py index 6c299cafa5..4b78b4d098 100644 --- a/synapse/storage/databases/main/transactions.py +++ b/synapse/storage/databases/main/transactions.py @@ -560,3 +560,14 @@ class TransactionWorkerStore(CacheInvalidationWorkerStore): return await self.db_pool.runInteraction( "get_destinations_paginate_txn", get_destinations_paginate_txn ) + + async def is_destination_known(self, destination: str) -> bool: + """Check if a destination is known to the server.""" + result = await self.db_pool.simple_select_one_onecol( + table="destinations", + keyvalues={"destination": destination}, + retcol="1", + allow_none=True, + desc="is_destination_known", + ) + return bool(result) |