mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-06 07:25:05 -04:00
Clean up some code in the retry logic (#6017)
* remove some unused code * make things which were constants into constants for efficiency and clarity
This commit is contained in:
parent
9c555f37e3
commit
7902bf1e1d
3 changed files with 14 additions and 36 deletions
|
@ -250,26 +250,6 @@ class TransactionStore(SQLBaseStore):
|
|||
},
|
||||
)
|
||||
|
||||
def get_destinations_needing_retry(self):
|
||||
"""Get all destinations which are due a retry for sending a transaction.
|
||||
|
||||
Returns:
|
||||
list: A list of dicts
|
||||
"""
|
||||
|
||||
return self.runInteraction(
|
||||
"get_destinations_needing_retry", self._get_destinations_needing_retry
|
||||
)
|
||||
|
||||
def _get_destinations_needing_retry(self, txn):
|
||||
query = (
|
||||
"SELECT * FROM destinations"
|
||||
" WHERE retry_last_ts > 0 and retry_next_ts < ?"
|
||||
)
|
||||
|
||||
txn.execute(query, (self._clock.time_msec(),))
|
||||
return self.cursor_to_dict(txn)
|
||||
|
||||
def _start_cleanup_transactions(self):
|
||||
return run_as_background_process(
|
||||
"cleanup_transactions", self._cleanup_transactions
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue